SuppressionCommentFilter is not allowed as a child in Checker"
Asked Answered
C

3

9

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>
Cycling answered 19/6, 2018 at 5:40 Comment(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 :)Cycling
You might consider adding that as an answer.Gust
C
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, and its working. :)

Cycling answered 28/1, 2022 at 17:56 Comment(0)
M
4

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

Montgolfier answered 20/3, 2019 at 17:9 Comment(2)
This is not helpful in terms of actual fix/solution suggestion.Nudi
Found link to this change in the PR - github.com/OpenGamma/OG-Tools/commit/… (shows what you need to do)Shaquitashara
L
3

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>
Lymphocytosis answered 3/11, 2021 at 10:23 Comment(0)
C
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, and its working. :)

Cycling answered 28/1, 2022 at 17:56 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.