-
Notifications
You must be signed in to change notification settings - Fork 37
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Configurable mixed tabs and spaces #848
Comments
Hey @adrszad, thanks for creating the issue and sorry for late reply. I think it's a valid point that it may be configurable. Would you see it as a rework of the rule I recall we have discussed it before with @bhirsz and we are aware that opinions are divided whether it's better to use spaces or tabs. That's the reason we decided that maybe it's better to not enforce one or the other, and only detect the case when both of them are mixed within one file. Personally, I would like Robocop to not enforce tabs or spaces and let people decide what they want to use, and not report the issue until it is explicitly set by the user that one or the other is required. So it'd be kind of a What do you think? As a sidenote, it may be a good candidate for the community rule (which we plan to add in the future), but I think it may also be included as a built-in rule, because I see it as a beneficial. |
It's actually working like this right now. If user only uses spaces, or tabs, So it could: mixed: by default, only check if there are mixed separators |
@bhirsz Yes, I know it works like this, but user has no control over what is used, because the rule only reports inconsistency. But it would be good to give the user a way to enforce tabs or spaces for each file. The only concern I have is how should we introduce it into Robocop, since we already have a rule Though, there is another issue now - if we want this rule to report on every place where the other separator is used, for the So maybe we should keep also the old rule that will check if the separators are inconsistent in the file and report only once? This way we will have one rule to report if they are mixed, and one to report the exact place where the unwanted separator is used. There is also a variant to add one more param to the new rule (or even old rule) and allow the users to decide whether it should report once or each occurrence, but I'm not a fan of this solution, since this affects too much how one rule may work. What do you think? |
I observe this rule is often confusing for the users, especially as no line number is given. It could be a project setting if we use spaces or tabs, and then each occurance of wrong separator could be logged separately with line number.
The text was updated successfully, but these errors were encountered: