PackageName: restrict to only lowercase letters

This commit is contained in:
Paul Campbell 2016-09-05 17:43:11 +01:00
parent 9e15232d1b
commit d63620c9b4
2 changed files with 4 additions and 4 deletions

View file

@ -1718,9 +1718,7 @@ Checks that the class has a `package` definition.
Checks the format of package names. Checks the format of package names.
Identifiers must match `^[a-z]+(\.[a-zA-Z_][a-zA-Z0-9_]*)*$`. Identifiers must match `^[a-z]+(\.[a-z]+)*$`.
> TODO: format = `^[a-z]+(\.[a-z]+)*$` - only lowercase letters, no numbers or underscores
#### [ParameterName](http://checkstyle.sourceforge.net/config_naming.html#ParameterName) #### [ParameterName](http://checkstyle.sourceforge.net/config_naming.html#ParameterName)

View file

@ -165,7 +165,9 @@
<module name="OverloadMethodsDeclarationOrder"/> <!-- group overloaded methods together --> <module name="OverloadMethodsDeclarationOrder"/> <!-- group overloaded methods together -->
<module name="PackageDeclaration"/> <!-- class must have package and it must match the directory --> <module name="PackageDeclaration"/> <!-- class must have package and it must match the directory -->
<module name="PackageName"/> <!-- validate package name format --> <module name="PackageName"> <!-- validate package name format -->
<property name="format" value="^[a-z]+(\.[a-z]+)*$"/> <!-- only lowercase letters, no numbers of underscores -->
</module>
<module name="ParameterName"/> <!-- validate parameter name format --> <module name="ParameterName"/> <!-- validate parameter name format -->
<module name="ParameterNumber"/> <!-- limits the number of parameters to 7 --> <module name="ParameterNumber"/> <!-- limits the number of parameters to 7 -->
<module name="ParenPad"/> <!-- parentheses should have no padding spaces --> <module name="ParenPad"/> <!-- parentheses should have no padding spaces -->