oclint/oclint — pull request #64 by lqi (2013-07-04 22:02:56+00:00)
Title: Comment-based Suppression and Context-based Suppression

This pull request introduces comment-based suppression and context-based suppression into the rule system.

Comment-based suppression is available for all rules. With comment-based suppression, rule violation can be suppressed by appending `//!OCLINT` to the same line where the violation is emitted. When a violation crosses multiple lines, add the comment to the first line of the violation.

Context-based suppression is available for all abstract syntax tree (AST) based rules, including generic AST rules, AST visitor rules, and AST matcher rules. With bounding `__attribute__((annotate("oclint:suppress[rule name]")))` or generic `__attribute__((annotate("oclint:suppress")))` to an AST node, when rule violations are identified to itself and/or any of its children nodes, the associated rule violations will be suppressed from emitting. (Currently, only LongLineRule is not based on AST context. In other words, context-based suppression is available for all rules except LongLineRule.)

This behavior is back-compatible with our existing suppression mechanism. But we have moved related logic up to the abstract class level. So comment-based suppression and context-based suppression are available to future AST based rules and source code reader rules for free.

Refer to issue oclint/oclint#52.