8000 SuppressWarningsHolder should allow usage of simple name of Checks in aliasList · Issue #11641 · checkstyle/checkstyle · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
SuppressWarningsHolder should allow usage of simple name of Checks in aliasList #11641
Closed
@romani

Description

@romani

https://checkstyle.org/config_annotation.html#SuppressWarningsHolder

$ cat Test.java
class Test {
  @SuppressWarnings("paramnum")
  public void needsLotsOfParameters( int a, 
  int b, int c, int d, int e, int f, int g, int h) {
    // ...
  }
}

$ cat config.xml
<?xml version="1.0"?>
<!DOCTYPE module PUBLIC "-//Puppy Crawl//DTD Check Configuration 1.3//EN"
       "https://checkstyle.org/dtds/configuration_1_3.dtd">
<module name="Checker">
	<property name="charset" value="UTF-8" />
	
   
<module name="TreeWalker">
   <module name="ParameterNumber">
   </module>
   
   <module name="SuppressWarningsHolder">
        <property name="aliasList" value="ParameterNumber=paramnum" />
  </module>
</module>

   <module name="SuppressWarningsFilter" />
</module>

$ java -jar checkstyle-10.1-all.jar -c config.xml Test.java
Starting audit...
[ERROR] /home/kevin/Desktop/C_Style/Test.java:4:15: More than 7 parameters (found 8). [ParameterNumber]
Audit done.

Expected: no violation.

workaround is to use fully qualified name of Check.
see details - #11542 (comment)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0