Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SuppressionCommentFilter is not allowed as a child in Checker"

Error: The Checkstyle rules file could not be parsed. SuppressionCommentFilter is not allowed as a child in Checker The file has been blacklisted for the 60s.

Note: the Checkstyle version which I am using is 7.1.2.

This is with a config that seems perfectly valid,

<module name="Checker">
  <property name="severity" value="warning" />
  <module name="TreeWalker">
    ...
  </module>
  ...
  <module name="SuppressWarningsFilter" />
  <module name="SuppressionFilter">
    <property name="file" value="${config_loc}/suppressions.xml"/>
  </module>
  <module name="SuppressionCommentFilter">
    <property name="checkC" value="false" />
  </module>
  ...
</module>
like image 786
Umesh Sulakude Avatar asked Nov 07 '22 05:11

Umesh Sulakude


2 Answers

see: release notes for release 8.1

Breaking backward compatibility:

Make SuppressionCommentFilter and SuppressWithNearbyCommentFilter children of TreeWalker. Author: Timur #4714

http://checkstyle.sourceforge.net/releasenotes.html

like image 136
Filip Avatar answered Nov 24 '22 09:11

Filip


To fix this error, find or use the "TreeWalker" module and move the offending module inside that module. I.e.

  <module name="TreeWalker">
    <!-- Require lines to be indented with tabs -->
    <module name="RegexpSinglelineJava">
      <property name="format" value="^\t* "/>
      <property name="message" value="Indent must use tab characters"/>
      <property name="ignoreComments" value="true"/>
    </module>
  </module>
like image 34
fjalvingh Avatar answered Nov 24 '22 09:11

fjalvingh