All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.puppycrawl.tools.checkstyle.meta.checks.coding.NoEnumTrailingCommaCheck.xml Maven / Gradle / Ivy

Go to download

Checkstyle is a development tool to help programmers write Java code that adheres to a coding standard

There is a newer version: 10.20.1
Show newest version
<?xml version="1.0" encoding="UTF-8"?>
<checkstyle-metadata>
   <module>
      <check fully-qualified-name="com.puppycrawl.tools.checkstyle.checks.coding.NoEnumTrailingCommaCheck"
             name="NoEnumTrailingComma"
             parent="com.puppycrawl.tools.checkstyle.TreeWalker">
         <description>&lt;p&gt;
  Checks that enum definition does not contain a trailing comma.
  Rationale: JLS allows trailing commas in arrays and enumerations, but does not allow
  them in other locations. To unify the coding style, the use of trailing commas should
  be prohibited.
 &lt;/p&gt;
 &lt;pre&gt;
 enum Foo1 {
   FOO,
   BAR;
 }
 &lt;/pre&gt;
 &lt;p&gt;
  The check demands that there should not be any comma after last constant in
  enum definition.
 &lt;/p&gt;
 &lt;pre&gt;
 enum Foo1 {
   FOO,
   BAR, //violation
 }
 &lt;/pre&gt;</description>
         <message-keys>
            <message-key key="no.enum.trailing.comma"/>
         </message-keys>
      </check>
   </module>
</checkstyle-metadata>




© 2015 - 2024 Weber Informatics LLC | Privacy Policy