8

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>
Ram Koti
  • 2,203
  • 7
  • 26
  • 36
Umesh Sulakude
  • 286
  • 2
  • 14
  • 2
    I got this resolved by matching the versions of Intellij checkstyle version and checks style jar file which i was uploading :). I used Intellj version 8.1 Check style jar which i was uploading 7.1.2. now i changed both to 7.1.2, its working :) – Umesh Sulakude Jun 20 '18 at 06:09
  • 1
    You might consider adding that as an answer. – M_M Mar 04 '21 at 11:48

3 Answers3

3

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

Filip
  • 906
  • 3
  • 11
  • 33
  • 4
    This is not helpful in terms of actual fix/solution suggestion. – Anna T Dec 24 '20 at 14:05
  • 2
    Found link to this change in the PR - https://github.com/OpenGamma/OG-Tools/commit/7fc6a37016ab41c7c51e71879c51d3d0fd5add50 (shows what you need to do) – Pavel Horal Apr 01 '21 at 18:40
2

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>
fjalvingh
  • 790
  • 1
  • 8
  • 20
1

I got this resolved by matching the versions of Intellij checkstyle version and checks style jar file which I was uploading :). I used Intellj version 8.1 Check style jar which I was uploading 7.1.2. Now I changed both to 7.1.2, and its working. :)

ouflak
  • 2,458
  • 10
  • 44
  • 49
Umesh Sulakude
  • 286
  • 2
  • 14