Skip to content

Commit

Permalink
Disallow class-level warning suppression
Browse files Browse the repository at this point in the history
`@SuppressWarnings` should be applied to narrowest scope possible.
  • Loading branch information
findepi committed May 29, 2024
1 parent 1253ecf commit 3ea2b5c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
Airbase 157
* Checkstyle updates:
- Disallow class-level warning suppression
- Require empty line before record definition

Airbase 156
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,10 @@
<module name="TreeWalker">
<module name="SuppressWarningsHolder" />

<module name="SuppressWarnings">
<property name="tokens" value="CLASS_DEF, INTERFACE_DEF, ENUM_DEF, ANNOTATION_DEF, RECORD_DEF" />
</module>

<module name="SuppressionXpathSingleFilter">
<property name="checks" value="RedundantModifier"/>
<property name="query" value="//(CLASS_DEF|RECORD_DEF)/OBJBLOCK/*/MODIFIERS/*"/>
Expand Down

0 comments on commit 3ea2b5c

Please sign in to comment.