|
18 | 18 | <property name="message" value="Empty javadoc comments are forbidden"/>
|
19 | 19 | </module>
|
20 | 20 |
|
21 |
| - <!-- |
| 21 | + <!-- |
22 | 22 | We include snippets that are wrapped in `// tag` and `// end` into the
|
23 | 23 | docs, stripping the leading spaces. If the context is wider than 76
|
24 | 24 | characters then it'll need to scroll. This fails the build if it sees
|
|
103 | 103 | <property name="ignoreComments" value="true" />
|
104 | 104 | </module>
|
105 | 105 | <!-- end Orwellian suppression of Serializable -->
|
| 106 | + |
| 107 | + <!-- Forbid equality comparisons with `true` --> |
| 108 | + <module name="DescendantToken"> |
| 109 | + <property name="tokens" value="EQUAL"/> |
| 110 | + <property name="limitedTokens" value="LITERAL_TRUE"/> |
| 111 | + <property name="maximumNumber" value="0"/> |
| 112 | + <property name="maximumDepth" value="1"/> |
| 113 | + <message key="descendant.token.max" value="Do not check for equality with 'true', since it is implied"/> |
| 114 | + </module> |
| 115 | + |
| 116 | + <!-- Forbid using '!' for logical negations in favour of checking |
| 117 | + against 'false' explicitly. --> |
| 118 | + <!-- This is disabled for now because there are many, many violations, |
| 119 | + hence the rule is reporting at the "warning" severity. --> |
| 120 | + |
| 121 | + <!-- |
| 122 | + <module name="DescendantToken"> |
| 123 | + <property name="severity" value="warning"/> |
| 124 | + <property name="tokens" value="EXPR"/> |
| 125 | + <property name="limitedTokens" value="LNOT"/> |
| 126 | + <property name="maximumNumber" value="0"/> |
| 127 | + <property name="maximumDepth" value="1"/> |
| 128 | + <message key="descendant.token.max" value="Do not negate boolean expressions with '!', but check explicitly with '== false' as it is more explicit"/> |
| 129 | + </module> |
| 130 | + --> |
| 131 | + |
106 | 132 | </module>
|
107 | 133 | </module>
|
0 commit comments