Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.
Sign upMore style checking. #1954
Conversation
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
madmaxoft
May 6, 2015
Member
Unfortunately the spaces-around-operators is quite difficult and had a few false positives, so I had to work around them. Spaces around minus cannot be checked at all, due to minus being used as a hyphen between words.
|
Unfortunately the spaces-around-operators is quite difficult and had a few false positives, so I had to work around them. Spaces around minus cannot be checked at all, due to minus being used as a hyphen between words. |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
bearbin
May 6, 2015
Member
There are a huge amount of false positives for "/", so many I don't think it's really worth it to check for spaces there.
|
There are a huge amount of false positives for "/", so many I don't think it's really worth it to check for spaces there. |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
|
It's not that bad, and I worked around all of them anyway. |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
tigerw
May 7, 2015
Member
Those are quite a lot of somewhat unnecessary changes; could you get the script to ignore lines that are comments?
|
Those are quite a lot of somewhat unnecessary changes; could you get the script to ignore lines that are comments? |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
madmaxoft
May 7, 2015
Member
Oh I don't mind the changes in the comments at all, all of those are good. The only thing I don't quite like is the `" HTTP/1.0" needing to be split into two strings. If you can write a Lua pattern that matches the others but not this, be my guest.
|
Oh I don't mind the changes in the comments at all, all of those are good. The only thing I don't quite like is the `" HTTP/1.0" needing to be split into two strings. If you can write a Lua pattern that matches the others but not this, be my guest. |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
tigerw
May 7, 2015
Member
Though it's still an additional (comment) style for people to conform to, and not out of necessity either, but a side-effect from something else. Since comments should follow language, not code conventions, it would be better for the style checker to ignore them. @bearbin also recommends that similarly strings be ignored also, which also fixes your problem.
|
Though it's still an additional (comment) style for people to conform to, and not out of necessity either, but a side-effect from something else. Since comments should follow language, not code conventions, it would be better for the style checker to ignore them. @bearbin also recommends that similarly strings be ignored also, which also fixes your problem. |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
worktycho
May 7, 2015
Member
The problem with comments is that its difficult to write a pattern to check is something is in a comment. I could probably manage a perl regex to do it, but even that would be a mess. Its certainly problematic with patterns to avoid: /* a b c */ a/a /* a */ getting ignored.
|
The problem with comments is that its difficult to write a pattern to check is something is in a comment. I could probably manage a perl regex to do it, but even that would be a mess. Its certainly problematic with patterns to avoid: |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
worktycho
May 7, 2015
Member
The regex is: ^(\/\*([^*]|\*[^/])*\*\/[^op]*)*(([^ ]op)|op[^ *]) where op is the operator. I don't know how you'ld write that in lua patterns.
|
The regex is: |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
madmaxoft
May 9, 2015
Member
I've fixed the operator-space patterns, now they ignore everything near doublequotes. So I got rid of the unwanted changes.
|
I've fixed the operator-space patterns, now they ignore everything near doublequotes. So I got rid of the unwanted changes. |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
|
This is being got by the broken master. Can you rebase on to the fix? |
madmaxoft
added some commits
May 9, 2015
added a commit
that referenced
this pull request
May 9, 2015
madmaxoft
merged commit ca94944
into
master
May 9, 2015
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
madmaxoft
May 9, 2015
Member
The Appveyor build has been stuck so I cancelled it, the other builds passed.
|
The Appveyor build has been stuck so I cancelled it, the other builds passed. |
madmaxoft commentedMay 6, 2015
Spaces around some operators are checked.