Allow '_' in checkstyle PackageName rule 60/46860/2
authorTom Pantelis <tpanteli@brocade.com>
Thu, 13 Oct 2016 06:06:39 +0000 (02:06 -0400)
committerRobert Varga <nite@hq.sk>
Thu, 13 Oct 2016 12:23:43 +0000 (12:23 +0000)
The JLS allows '_' in package names but the default checkstyle regex
pattern for the PackageName rule doesn't. Underscores shouldn't normally
be used but the yang code generator can generate package names with
underscores. We can exclude most yang-generated code from checkstyle but
the CSS code generator places some classes under src/main/java to be
completed (ie *Module classes) so we need the regex pattern to allow
underscores.

Change-Id: I14fdb1955499d5684b1bdaeabd188f7d425caf60
Signed-off-by: Tom Pantelis <tpanteli@brocade.com>
checkstyle/src/main/resources/odl_checks.xml

index cecba405260fb2359f0e264525e165814ac5c2b8..a84bee2891f280906b78c6e193e68b7e8b9bb219 100644 (file)
@@ -94,7 +94,7 @@
             <property name="option" value="EOL"/>
         </module>
         <module name="PackageName">
-            <property name="format" value="^[a-z]+(\.[a-z][a-z0-9]*)*$"/>
+            <property name="format" value="^[a-z]+(\.[a-z][a-z0-9_]*)*$"/>
             <message key="name.invalidPattern"
              value="Package name ''{0}'' must match pattern ''{1}''."/>
         </module>