Skip to content

How to ignore Code Critics rules?

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.