Skip to content

False-negative: SummaryJavadoc:forbiddenSummaryFragments for tab-formatted code #18644

@lrozenblyum

Description

@lrozenblyum

I have read check documentation: https://checkstyle.sourceforge.io/checks/javadoc/summaryjavadoc.html#forbiddenSummaryFragments
I have downloaded the latest checkstyle from: https://checkstyle.org/cmdline.html#Download_and_Run
I have executed the cli and showed it below, as cli describes the problem better than 1,000 words

E:\temp\CheckstyleReport>type 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">
  <module name="TreeWalker">
    <module name="SummaryJavadoc">
      <property name="forbiddenSummaryFragments"
        value="^[a-z]"/>
    </module>
  </module>
</module>

E:\temp\CheckstyleReport>type Test.java
class Test {
        /**
         * adds an element to the list.
         *
         * @param element the element to add
         */
        public void add(String element) {}
}

E:\temp\CheckstyleReport>set RUN_LOCALE="-Duser.language=en -Duser.country=US"

E:\temp\CheckstyleReport>java %RUN_LOCALE% -jar checkstyle-13.0.0-all.jar -c config.xml Test.java
Starting audit...
Audit done.

E:\temp\CheckstyleReport>

Describe what you expect in detail.
Since Javadoc summary starts from lowercase and since forbiddenSummaryFragments has a pattern part ^[a-z] I'd assume there should be reported a violation.

However it's not reported (NOTE: the file is tab-formatted).


Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions