-
Notifications
You must be signed in to change notification settings - Fork 74
local_codechecker: Add sniffer to verify spaces around operators #11
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
Conversation
Nice work Ankit! Please could you add some unit tests to verify the change? |
It is a upstream sniffer, do we still need tests for it? |
Yeah to verify the rules match our rules & that future upstream updates don't break our rules (it's super easy to add the tests, look at the ones I just added :-)) |
Added tests now, hope that covers everything 👍 |
I added a comment about the fixture file - I think its a bit misleading. I ran the checker on moodlelib (recently cleaned up to not be throwing many errors) and it didn't find too many things. For loop assignments are an interesting one:
In any case, I would prefer to wait for Eloy for this (he has mostly been taking care of codechecker changes) |
Thanks Dan, |
Hi, some comments:
Edited: s/were/was |
Hi Eloy,
Thanks |
Hi Ankit, IMO, let's reduce this to the original "spaces around operators" goal (plz, add some test looking for multiple spaces as commented). And let the blank lines and EOL @ EOF points not implemented for now. I don't think we'll raise any agreement about them and are really not important. TIA! |
Hi Eloy, |
local_codechecker: Add sniffer to verify spaces around operators
Merged, thanks Ankit! |
Coding style doc says, we should always have spaces around operators. This sniff should verify that.
http://docs.moodle.org/dev/Coding_style#Control_statements