Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue #13061: Update grammar for @exception, @throws, and @param tags #14803

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

0xbakry
Copy link
Contributor

@0xbakry 0xbakry commented Apr 16, 2024

Solves #13061

CLI:

config.xml

$ cat config.xml
<?xml version="1.0"?>
<!DOCTYPE module PUBLIC
        "-//Checkstyle//DTD Checkstyle 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="NonEmptyAtclauseDescription"/>
    </module>
</module>

@param tag:

$ cat Test.java
public class Test {

  /**
   * @param
   */
  public int method(String str)
  {
      return 1;
  }
}

$ java -jar checkstyle-10.15.1-SNAPSHOT-all.jar -c config.xml Test.java
Starting audit...
[ERROR] D:\checkproject\parser\Test.java:4: At-clause should have a non-empty description. [NonEmptyAtclauseDescription]
Audit done.
Checkstyle ends with 1 errors.

@exception tag

$ cat Test1.java
public class Test1 {
    /**
     * @exception
     */
    public int foo8(String a) throws Exception
    {
        return 1;
    }
}

$ java -jar checkstyle-10.15.1-SNAPSHOT-all.jar -c config.xml Test1.java
Starting audit...
[ERROR] D:\checkproject\parser\Test1.java:3: At-clause should have a non-empty description. [NonEmptyAtclauseDescription]
Audit done.
Checkstyle ends with 1 errors.

@throws tag

$ cat Test2.java
public class Test1 {
    /**
     * @throws
     */
    public int foo8(String a) throws Exception
    {
        return 1;
    }

}

$ java -jar checkstyle-10.15.1-SNAPSHOT-all.jar -c config.xml Test2.java
Starting audit...
[ERROR] D:\checkproject\parser\Test2.java:3: At-clause should have a non-empty description. [NonEmptyAtclauseDescription]
Audit done.
Checkstyle ends with 1 errors.

Now we don't have parser errors.

Diff Regression projects: https://gist.githubusercontent.com/0xbakry/7853843aa3d69aee301d7a8d62d08ebb/raw/65a7d6bee0ad8ad789c17f778ce7d8b0056ae28b/my_projects
Diff Regression config: https://gist.githubusercontent.com/0xbakry/a1fcb13eef42f29de8ff500892f34166/raw/beceb87d12215501a53ffc29e87f6c0af78f588c/config_check.xml

@0xbakry
Copy link
Contributor Author

0xbakry commented Apr 16, 2024

GitHub, generate report

Copy link
Member

@romani romani left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Report is good.
Some maintainer need to create PR from same code to pass all CIs. We can do this before merge.

Minor

@0xbakry 0xbakry force-pushed the parser branch 3 times, most recently from d052b98 to c341c2d Compare April 17, 2024 19:23
Copy link
Contributor

Copy link
Member

@romani romani left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok to merge

@0xbakry
Copy link
Contributor Author

0xbakry commented Apr 28, 2024

@nrmancuso @rnveach ping

@rnveach
Copy link
Member

rnveach commented Apr 28, 2024

@0xbakry I am not assigned. Usually we ask for antlr regression on these type of changes, so I would probably be asking for something like that if we can.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants