pull/153/head
昶乐 7 years ago
parent 40bcf5441a
commit 8a2cd82a73

@ -30,7 +30,7 @@ import net.sourceforge.pmd.lang.ast.Node;
*/
public class PackageNamingRule extends AbstractXpathRule {
private static final String XPATH = "//PackageDeclaration/Name\n"
+ "[not (matches(@Image, '^[a-z]+(\\.[a-z][a-z0-9]*)*$'))]";
+ "[not (matches(@Image, '^[a-z0-9]+(\\.[a-z][a-z0-9]*)*$'))]";
public PackageNamingRule() {
setXPath(XPATH);

@ -31,5 +31,19 @@
</test-code>
<code-fragment id="PackageNamingRule2">
<![CDATA[
package ali88.ps.service;
public class SomeClass {
}
]]>
</code-fragment>
<test-code>
<description>Package Name should be lowercase</description>
<expected-problems>0</expected-problems>
<code-ref id="PackageNamingRule2" />
</test-code>
</test-data>

Loading…
Cancel
Save