-
Notifications
You must be signed in to change notification settings - Fork 19
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
linter does not detect missing space between variable and minus sign #170
Comments
Thanks for the report!
You're right. This part of the linter runs on the lexicon. There it just sees individual tokens, rather than control structures. Specifically, it is part of the "bad sequences" linter, which is just "if you see this sequence of tokens, throw that warning". As such it cannot see the difference between the unary and the binary Adding support for that operator is nasty enough that it's probably not worth the effort.
This can be done I think. Can that location just be in the message, or should it be encoded in some special way for IDEs to point at it? Message should be fine right?
Would be nice, but this would false positive on a lot of places where code is aligned. Admittedly that is no longer my style, but people are likely to get annoyed by seeing warnings for things they intended.
That makes sense 👍 |
Just the message is fine, yeah.
Perhaps putting it behind an option flag would be reasonable for this. |
Just encountered another weird issue - pretty printing this function moves the comment out of the function:
If I should open a new issue for this, let me know. |
Yeah, putting comments back where they were sounds super simple, but it has turned out to be the most challenging aspect implemented in Glualint. |
To summarize this issue:
Won't fix, as
Fixed in #174
Won't fix. It's a feature request that would be somewhat nice to have, but I foresee it also being annoying to implement correctly. There might also be a high likelyhood of false positives, e.g. when people align their code. I could then add a config, but it doesn't feel like it's worth the trouble.
Fixed in 57f6f4f
Fixed in #173 That closes the issue! |
Released here: https://github.com/FPtje/GLuaFixer/releases as 1.27.0 |
x-2
is not detected as a style problem, whilex/2
orx+2
are.I imagine this is tripped up by detection of negative numbers.
Sample code
Output:
Other issues/wishlist:
( test )
=>( test )
or( a and b )
=>( a and b )
Empty if statement
warning should cover the entire if statement (start/end positions), not just theif
itself, just like empty loops do.The text was updated successfully, but these errors were encountered: