diff --git a/feed.xml b/feed.xml
index 1f4ec75599..1fe02af3a5 100644
--- a/feed.xml
+++ b/feed.xml
@@ -5,8 +5,8 @@
Priority: High (1)
-Class names should always begin with an upper case character.
+Configurable naming conventions for type declarations. This rule reports +type declarations which do not match the regex that applies to their +specific kind (e.g. enum or interface). Each regex can be configured through +properties.
+ +By default this rule uses the standard Apex naming convention (Pascal case).
This rule is defined by the following Java class: net.sourceforge.pmd.lang.apex.rule.codestyle.ClassNamingConventionsRule
Example(s):
-public class Foo {}
+public class FooClass { } // This is in pascal case, so it's ok
+
+public class fooClass { } // This will be reported unless you change the regex
This rule has the following properties:
@@ -1326,6 +1333,36 @@ $('#toc').toc({ minimumHeaders: 0, listType: 'ul', showSpeed: 0, headers: 'h2,h3
Deprecated Code Climate Block Highlighting
no
+
+ testClassPattern
+ [A-Z][a-zA-Z0-9_]*
+ Regex which applies to test class names
+ no
+
+
+ abstractClassPattern
+ [A-Z][a-zA-Z0-9_]*
+ Regex which applies to abstract class names
+ no
+
+
+ classPattern
+ [A-Z][a-zA-Z0-9_]*
+ Regex which applies to class names
+ no
+
+
+ interfacePattern
+ [A-Z][a-zA-Z0-9_]*
+ Regex which applies to interface names
+ no
+
+
+ enumPattern
+ [A-Z][a-zA-Z0-9_]*
+ Regex which applies to enum names
+ no
+
@@ -1333,6 +1370,120 @@ $('#toc').toc({ minimumHeaders: 0, listType: 'ul', showSpeed: 0, headers: 'h2,h3
<rule ref="category/apex/codestyle.xml/ClassNamingConventions" />
+Use this rule and customize it:
+<rule ref="category/apex/codestyle.xml/ClassNamingConventions">
+ <properties>
+ <property name="testClassPattern" value="[A-Z][a-zA-Z0-9_]*" />
+ <property name="abstractClassPattern" value="[A-Z][a-zA-Z0-9_]*" />
+ <property name="classPattern" value="[A-Z][a-zA-Z0-9_]*" />
+ <property name="interfacePattern" value="[A-Z][a-zA-Z0-9_]*" />
+ <property name="enumPattern" value="[A-Z][a-zA-Z0-9_]*" />
+ </properties>
+</rule>
+
+
+FieldNamingConventions
+
+Since: PMD 6.15.0
+
+Priority: High (1)
+
+Configurable naming conventions for field declarations. This rule reports variable declarations
+which do not match the regex that applies to their specific kind —e.g. constants (static final),
+static field, final field. Each regex can be configured through properties.
+
+By default this rule uses the standard Apex naming convention (Camel case).
+
+This rule is defined by the following Java class: net.sourceforge.pmd.lang.apex.rule.codestyle.FieldNamingConventionsRule
+
+Example(s):
+
+public class Foo {
+ Integer instanceField; // This is in camel case, so it's ok
+
+ Integer INSTANCE_FIELD; // This will be reported unless you change the regex
+}
+
+
+This rule has the following properties:
+
+
+
+
+ Name
+ Default Value
+ Description
+ Multivalued
+
+
+
+
+ cc_categories
+ Style
+ Deprecated Code Climate Categories
+ yes. Delimiter is ‘|’.
+
+
+ cc_remediation_points_multiplier
+ 1
+ Deprecated Code Climate Remediation Points multiplier
+ no
+
+
+ cc_block_highlighting
+ false
+ Deprecated Code Climate Block Highlighting
+ no
+
+
+ enumConstantPattern
+ [A-Z][A-Z0-9_]*
+ Regex which applies to enum constant field names
+ no
+
+
+ constantPattern
+ [A-Z][A-Z0-9_]*
+ Regex which applies to constant field names
+ no
+
+
+ finalPattern
+ [a-z][a-zA-Z0-9]*
+ Regex which applies to final field names
+ no
+
+
+ staticPattern
+ [a-z][a-zA-Z0-9]*
+ Regex which applies to static field names
+ no
+
+
+ instancePattern
+ [a-z][a-zA-Z0-9]*
+ Regex which applies to instance field names
+ no
+
+
+
+
+Use this rule with the default properties by just referencing it:
+<rule ref="category/apex/codestyle.xml/FieldNamingConventions" />
+
+
+Use this rule and customize it:
+<rule ref="category/apex/codestyle.xml/FieldNamingConventions">
+ <properties>
+ <property name="enumConstantPattern" value="[A-Z][A-Z0-9_]*" />
+ <property name="constantPattern" value="[A-Z][A-Z0-9_]*" />
+ <property name="finalPattern" value="[a-z][a-zA-Z0-9]*" />
+ <property name="staticPattern" value="[a-z][a-zA-Z0-9]*" />
+ <property name="instancePattern" value="[a-z][a-zA-Z0-9]*" />
+ </properties>
+</rule>
+
+
ForLoopsMustUseBraces
Since: PMD 5.6.0
@@ -1396,6 +1547,88 @@ from the rest.
<rule ref="category/apex/codestyle.xml/ForLoopsMustUseBraces" />
+FormalParameterNamingConventions
+
+Since: PMD 6.15.0
+
+Priority: High (1)
+
+Configurable naming conventions for formal parameters of methods.
+This rule reports formal parameters which do not match the regex that applies to their
+specific kind (e.g. method parameter, or final method parameter). Each regex can be
+configured through properties.
+
+By default this rule uses the standard Apex naming convention (Camel case).
+
+This rule is defined by the following Java class: net.sourceforge.pmd.lang.apex.rule.codestyle.FormalParameterNamingConventionsRule
+
+Example(s):
+
+public class Foo {
+ public bar(Integer methodParameter) { } // This is in camel case, so it's ok
+
+ public baz(Integer METHOD_PARAMETER) { } // This will be reported unless you change the regex
+}
+
+
+This rule has the following properties:
+
+
+
+
+ Name
+ Default Value
+ Description
+ Multivalued
+
+
+
+
+ cc_categories
+ Style
+ Deprecated Code Climate Categories
+ yes. Delimiter is ‘|’.
+
+
+ cc_remediation_points_multiplier
+ 1
+ Deprecated Code Climate Remediation Points multiplier
+ no
+
+
+ cc_block_highlighting
+ false
+ Deprecated Code Climate Block Highlighting
+ no
+
+
+ finalMethodParameterPattern
+ [a-z][a-zA-Z0-9]*
+ Regex which applies to final method parameter names
+ no
+
+
+ methodParameterPattern
+ [a-z][a-zA-Z0-9]*
+ Regex which applies to method parameter names
+ no
+
+
+
+
+Use this rule with the default properties by just referencing it:
+<rule ref="category/apex/codestyle.xml/FormalParameterNamingConventions" />
+
+
+Use this rule and customize it:
+<rule ref="category/apex/codestyle.xml/FormalParameterNamingConventions">
+ <properties>
+ <property name="finalMethodParameterPattern" value="[a-z][a-zA-Z0-9]*" />
+ <property name="methodParameterPattern" value="[a-z][a-zA-Z0-9]*" />
+ </properties>
+</rule>
+
+
IfElseStmtsMustUseBraces
Since: PMD 5.6.0
@@ -1522,26 +1755,115 @@ controlled from the rest.
<rule ref="category/apex/codestyle.xml/IfStmtsMustUseBraces" />
-MethodNamingConventions
+LocalVariableNamingConventions
-Since: PMD 5.5.0
+Since: PMD 6.15.0
Priority: High (1)
-Method names should always begin with a lower case character, and should not contain underscores.
+Configurable naming conventions for local variable declarations.
+This rule reports variable declarations which do not match the regex that applies to their
+specific kind (e.g. local variable, or final local variable). Each regex can be configured through
+properties.
-This rule is defined by the following Java class: net.sourceforge.pmd.lang.apex.rule.codestyle.MethodNamingConventionsRule
+By default this rule uses the standard Apex naming convention (Camel case).
+
+This rule is defined by the following Java class: net.sourceforge.pmd.lang.apex.rule.codestyle.LocalVariableNamingConventionsRule
Example(s):
public class Foo {
- public void fooStuff() {
+ public Foo() {
+ Integer localVariable; // This is in camel case, so it's ok
+
+ Integer LOCAL_VARIABLE; // This will be reported unless you change the regex
}
}
This rule has the following properties:
+
+
+
+ Name
+ Default Value
+ Description
+ Multivalued
+
+
+
+
+ cc_categories
+ Style
+ Deprecated Code Climate Categories
+ yes. Delimiter is ‘|’.
+
+
+ cc_remediation_points_multiplier
+ 1
+ Deprecated Code Climate Remediation Points multiplier
+ no
+
+
+ cc_block_highlighting
+ false
+ Deprecated Code Climate Block Highlighting
+ no
+
+
+ finalLocalPattern
+ [a-z][a-zA-Z0-9]*
+ Regex which applies to final local variable names
+ no
+
+
+ localPattern
+ [a-z][a-zA-Z0-9]*
+ Regex which applies to local variable names
+ no
+
+
+
+
+Use this rule with the default properties by just referencing it:
+<rule ref="category/apex/codestyle.xml/LocalVariableNamingConventions" />
+
+
+Use this rule and customize it:
+<rule ref="category/apex/codestyle.xml/LocalVariableNamingConventions">
+ <properties>
+ <property name="finalLocalPattern" value="[a-z][a-zA-Z0-9]*" />
+ <property name="localPattern" value="[a-z][a-zA-Z0-9]*" />
+ </properties>
+</rule>
+
+
+MethodNamingConventions
+
+Since: PMD 5.5.0
+
+Priority: High (1)
+
+Configurable naming conventions for method declarations. This rule reports
+method declarations which do not match the regex that applies to their
+specific kind (e.g. static method, or test method). Each regex can be
+configured through properties.
+
+By default this rule uses the standard Apex naming convention (Camel case).
+
+This rule is defined by the following Java class: net.sourceforge.pmd.lang.apex.rule.codestyle.MethodNamingConventionsRule
+
+Example(s):
+
+public class Foo {
+ public void instanceMethod() { } // This is in camel case, so it's ok
+
+ public void INSTANCE_METHOD() { } // This will be reported unless you change the regex
+
+
+This rule has the following properties:
+
@@ -1573,7 +1895,25 @@ controlled from the rest.
skipTestMethodUnderscores
false
- Skip underscores in test methods
+ Deprecated Skip underscores in test methods
+ no
+
+
+ testPattern
+ [a-z][a-zA-Z0-9]*
+ Regex which applies to test method names
+ no
+
+
+ staticPattern
+ [a-z][a-zA-Z0-9]*
+ Regex which applies to static method names
+ no
+
+
+ instancePattern
+ [a-z][a-zA-Z0-9]*
+ Regex which applies to instance method names
no
@@ -1586,7 +1926,9 @@ controlled from the rest.
Use this rule and customize it:
<rule ref="category/apex/codestyle.xml/MethodNamingConventions">
<properties>
- <property name="skipTestMethodUnderscores" value="false" />
+ <property name="testPattern" value="[a-z][a-zA-Z0-9]*" />
+ <property name="staticPattern" value="[a-z][a-zA-Z0-9]*" />
+ <property name="instancePattern" value="[a-z][a-zA-Z0-9]*" />
</properties>
</rule>
@@ -1672,8 +2014,92 @@ can lead to quite messy code. This rule looks for several declarations on the sa
</rule>
+PropertyNamingConventions
+
+Since: PMD 6.15.0
+
+Priority: High (1)
+
+Configurable naming conventions for property declarations. This rule reports
+property declarations which do not match the regex that applies to their
+specific kind (e.g. static property, or instance property). Each regex can be
+configured through properties.
+
+By default this rule uses the standard Apex naming convention (Camel case).
+
+This rule is defined by the following Java class: net.sourceforge.pmd.lang.apex.rule.codestyle.PropertyNamingConventionsRule
+
+Example(s):
+
+public class Foo {
+ public Integer instanceProperty { get; set; } // This is in camel case, so it's ok
+
+ public Integer INSTANCE_PROPERTY { get; set; } // This will be reported unless you change the regex
+}
+
+
+This rule has the following properties:
+
+
+
+
+ Name
+ Default Value
+ Description
+ Multivalued
+
+
+
+
+ cc_categories
+ Style
+ Deprecated Code Climate Categories
+ yes. Delimiter is ‘|’.
+
+
+ cc_remediation_points_multiplier
+ 1
+ Deprecated Code Climate Remediation Points multiplier
+ no
+
+
+ cc_block_highlighting
+ false
+ Deprecated Code Climate Block Highlighting
+ no
+
+
+ staticPattern
+ [a-z][a-zA-Z0-9]*
+ Regex which applies to static property names
+ no
+
+
+ instancePattern
+ [a-z][a-zA-Z0-9]*
+ Regex which applies to instance property names
+ no
+
+
+
+
+Use this rule with the default properties by just referencing it:
+<rule ref="category/apex/codestyle.xml/PropertyNamingConventions" />
+
+
+Use this rule and customize it:
+<rule ref="category/apex/codestyle.xml/PropertyNamingConventions">
+ <properties>
+ <property name="staticPattern" value="[a-z][a-zA-Z0-9]*" />
+ <property name="instancePattern" value="[a-z][a-zA-Z0-9]*" />
+ </properties>
+</rule>
+
+
VariableNamingConventions
+Deprecated
+
Since: PMD 5.5.0
Priority: High (1)
@@ -1682,6 +2108,12 @@ can lead to quite messy code. This rule looks for several declarations on the sa
checks for final variables that should be fully capitalized and non-final variables
that should not include underscores.
+This rule is deprecated and will be removed with PMD 7.0.0. The rule is replaced
+by the more general rules quot
,
+quot
,
+quot
, and
+quot
.
+
This rule is defined by the following Java class: net.sourceforge.pmd.lang.apex.rule.codestyle.VariableNamingConventionsRule
Example(s):
diff --git a/search.json b/search.json
index 186627c625..e1ced3bb62 100644
--- a/search.json
+++ b/search.json
@@ -1011,6 +1011,15 @@
}
,
+{
+"title": "FieldNamingConventions (Apex, Code Style)",
+"tags": "",
+"keywords": "FieldNamingConventions",
+"url": "pmd_rules_apex_codestyle.html#fieldnamingconventions",
+"summary": "Rules which enforce a specific coding style."
+}
+,
+
{
"title": "ForLoopsMustUseBraces (Apex, Code Style)",
"tags": "",
@@ -1020,6 +1029,24 @@
}
,
+{
+"title": "FormalParameterNamingConventions (Apex, Code Style)",
+"tags": "",
+"keywords": "FormalParameterNamingConventions",
+"url": "pmd_rules_apex_codestyle.html#formalparameternamingconventions",
+"summary": "Rules which enforce a specific coding style."
+}
+,
+
+{
+"title": "LocalVariableNamingConventions (Apex, Code Style)",
+"tags": "",
+"keywords": "LocalVariableNamingConventions",
+"url": "pmd_rules_apex_codestyle.html#localvariablenamingconventions",
+"summary": "Rules which enforce a specific coding style."
+}
+,
+
{
"title": "MethodNamingConventions (Apex, Code Style)",
"tags": "",
@@ -1038,6 +1065,15 @@
}
,
+{
+"title": "PropertyNamingConventions (Apex, Code Style)",
+"tags": "",
+"keywords": "PropertyNamingConventions",
+"url": "pmd_rules_apex_codestyle.html#propertynamingconventions",
+"summary": "Rules which enforce a specific coding style."
+}
+,
+
{
"title": "VariableNamingConventions (Apex, Code Style)",
"tags": "",