-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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 style cop that checks for inline comments #1062
Conversation
salbertson
commented
May 1, 2014
- Create custom matcher for testing offenses
Looks good. Please, a changelog entry. |
Usually the number of offenses, the line number, the message and the highlights are checked in the specs. I think this is here useful too. Just take a look in the newly added specs. |
@salbertson Ping :-) |
@bbatsov, I'll make those changes soon. Thanks for checking in. |
@geniou, would you link to a test that checks the things you mentioned? I looked at a couple recent Cop specs and didn't find any tests for line numbers, message or highlights. |
@salbertson good question - I think @bbatsov has to decide. General it would be good if all (new) specs test these things, but I'm not sure if its wise / possible to enforce it. |
@salbertson Message checking makes sense only if the cop does dynamic message generation. Most cops should do highlights checking in the specs, but older don't as we hadn't originally devised this check. Personally, I rarely check the line numbers of the offenses in the specs I write. Anyways, you can have a look at the |
* Create custom matcher for testing offenses
@bbatsov Great, thanks. |
I also added a matcher that to help test messages. |
Add style cop that checks for inline comments
👍 The code looks good. |