A less well known feature of my recent changes and improvements to the Refactoring Browser, and especially the integrated Code Critic tools (including Slime, the Seaside consultant in a box) is the possibility to ignore certain rules on annotated methods. Simply add a pragma to the method you want a certain rule to ignore:
renderContentOn: html
"Renders the basic structure of the application."
<lint: 'Long methods' rationale: 'Rendering method' author: 'lr'>
...
The first argument is the title of the rule, as it appears in code critics user interface. Second and third argument are optional, but it usually makes sense to explain why it is a good decision to ignore the rule in the given method.
The idea is not to overuse this feature. That’s also why you actually have to type it in all by hand, even if it would be easy to automate that. The goal is to encourage developers to fix the real issue instead, something that works very well for me.
Comments
Excellent... very useful. I was worried about how you would use the lint tool if it kept warning you about stuff that you had decided was fine. Would be very hard to see the real problems.
Should the pragma be named something more like "lint-ignore:" though?
The latest version additionally supports a more readable from:
Furthermore, instead of the rule name the name of the class implementing the rule can be provided: