-
Notifications
You must be signed in to change notification settings - Fork 57
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
Add (optional) rule to check consistency of indentation? #50
Comments
Personally I think this is the wrong tool for the job. Conceptually I think a language linter looking for coding errors should completely ignore anything remotely user-preference or style related. Any valid language syntax should be fair game. Separately a different tool (or possible completely different run time mode of a common tool) could look at the coding style and lint, suggest, or just outright format to taste. This would facilitate CI jobs where style vs. syntax and logic issues were treated differently, style was or was not enforced, etc. Also the kind of options that go into what to allow in a language are fundamentally different from what to allow for style (in my view). Personally for things like enforcing indentation and checking for mixed space/tab usage I use editorconfig rules and editorconfig-checker for linting (other tools like That being said there is not another Lua specific tool (or mode) that handles style robustly at this time and there is precedent for whitespace handling rules mixed in the liter (e.g. https://github.com/lunarmodules/luacheck/blob/master/src/luacheck/stages/detect_bad_whitespace.lua) so I guess I don't have solid reason to object to that ruleset being expanded/improved. |
Thanks for those thoughtful comments. If the maintainers want this feature, I am available to help implement it; but if they don't want it, that is fine. |
Were you thinking this would be a line-wise, file-wise, or project-wise consistency check? |
I was thinking that if a user wants to use the check, they would put something in their configuration like:
...And then luacheck would perform the check on any file it scans. |
Or maybe the configuration might be something like this?
Or else:
|
the EmmyLuaCodeStyle support this feature,it supports the use of language server, lua lib, and command-line tools in three ways |
Thanks for mentioning that. |
Thank you for luacheck! It is a very nice tool.
Are you interested in adding a rule to check that indentation is consistent; for example, that only tabs or only spaces are used? Probably this would be disabled by default, to avoid breaking existing users.
If you like the idea, I would be happy to send a PR.
FYA @alerque
The text was updated successfully, but these errors were encountered: