forked from phoedos/pmd
Update generated rule documentation
This commit is contained in:
File diff suppressed because one or more lines are too long
@ -2527,11 +2527,15 @@ that are misplaced (not making groups of 3 digits) are reported.
|
||||
(: Filter out ignored field name :)
|
||||
[not(ancestor::VariableDeclarator[1][@Name = 'serialVersionUID'])]
|
||||
[
|
||||
some $num in tokenize(@Image, "[.dDfFlLeE+\-]")
|
||||
some $num in tokenize(@Image, "[dDfFlLeE+\-]")
|
||||
satisfies not(
|
||||
string-length($num) <= $acceptableDecimalLength
|
||||
and not(contains($num,"_"))
|
||||
or matches($num, "^[0-9]{1,3}(_[0-9]{3})*$")
|
||||
( contains($num, ".")
|
||||
and string-length(substring-before($num, ".")) <= $acceptableDecimalLength
|
||||
and string-length(substring-after($num, ".")) <= $acceptableDecimalLength
|
||||
or string-length($num) <= $acceptableDecimalLength
|
||||
)
|
||||
and not(contains($num,"_"))
|
||||
or matches($num, "^[0-9]{1,3}(_[0-9]{3})*(\.([0-9]{3}_)*[0-9]{1,3})?$")
|
||||
)
|
||||
]
|
||||
```
|
||||
|
@ -17,8 +17,10 @@ folder: pmd/rules
|
||||
|
||||
{% include callout.html content="Rules which enforce a specific coding style." %}
|
||||
|
||||
* [AvoidTabCharacter](pmd_rules_plsql_codestyle.html#avoidtabcharacter): This rule checks, that there are no tab characters ('\t') in the source file.It reports only the ...
|
||||
* [CodeFormat](pmd_rules_plsql_codestyle.html#codeformat): This rule verifies that the PLSQL code is properly formatted. The following checks are executed:S...
|
||||
* [ForLoopNaming](pmd_rules_plsql_codestyle.html#forloopnaming): In case you have loops please name the loop variables more meaningful.
|
||||
* [LineLength](pmd_rules_plsql_codestyle.html#linelength): This rule checks for long lines. Please note that comments are not ignored.This rule is the PMD e...
|
||||
* [MisplacedPragma](pmd_rules_plsql_codestyle.html#misplacedpragma): Oracle states that the PRAQMA AUTONOMOUS_TRANSACTION must be in the declaration block,but the cod...
|
||||
|
||||
## Design
|
||||
|
@ -5,10 +5,46 @@ permalink: pmd_rules_plsql_codestyle.html
|
||||
folder: pmd/rules/plsql
|
||||
sidebaractiveurl: /pmd_rules_plsql.html
|
||||
editmepath: ../pmd-plsql/src/main/resources/category/plsql/codestyle.xml
|
||||
keywords: Code Style, CodeFormat, MisplacedPragma, ForLoopNaming
|
||||
keywords: Code Style, AvoidTabCharacter, CodeFormat, MisplacedPragma, ForLoopNaming, LineLength
|
||||
language: PLSQL
|
||||
---
|
||||
<!-- DO NOT EDIT THIS FILE. This file is generated from file ../pmd-plsql/src/main/resources/category/plsql/codestyle.xml. -->
|
||||
## AvoidTabCharacter
|
||||
|
||||
**Since:** PMD 6.13.0
|
||||
|
||||
**Priority:** Medium (3)
|
||||
|
||||
This rule checks, that there are no tab characters (`\t`) in the source file.
|
||||
It reports only the first occurrence per file.
|
||||
|
||||
Using tab characters for indentation is not recommended, since this requires that every developer
|
||||
uses the same tab with in their editor.
|
||||
|
||||
This rule is the PMD equivalent of checkstyle's [FileTabCharacter](http://checkstyle.sourceforge.net/config_whitespace.html#FileTabCharacter) check.
|
||||
|
||||
**This rule is defined by the following Java class:** [net.sourceforge.pmd.lang.plsql.rule.codestyle.AvoidTabCharacterRule](https://github.com/pmd/pmd/blob/master/pmd-plsql/src/main/java/net/sourceforge/pmd/lang/plsql/rule/codestyle/AvoidTabCharacterRule.java)
|
||||
|
||||
**This rule has the following properties:**
|
||||
|
||||
|Name|Default Value|Description|Multivalued|
|
||||
|----|-------------|-----------|-----------|
|
||||
|eachLine|false|Whether to report each line with a tab character or only the first line|no|
|
||||
|
||||
**Use this rule with the default properties by just referencing it:**
|
||||
``` xml
|
||||
<rule ref="category/plsql/codestyle.xml/AvoidTabCharacter" />
|
||||
```
|
||||
|
||||
**Use this rule and customize it:**
|
||||
``` xml
|
||||
<rule ref="category/plsql/codestyle.xml/AvoidTabCharacter">
|
||||
<properties>
|
||||
<property name="eachLine" value="false" />
|
||||
</properties>
|
||||
</rule>
|
||||
```
|
||||
|
||||
## CodeFormat
|
||||
|
||||
**Since:** PMD 6.9.0
|
||||
@ -170,6 +206,40 @@ END;
|
||||
</rule>
|
||||
```
|
||||
|
||||
## LineLength
|
||||
|
||||
**Since:** PMD 6.13.0
|
||||
|
||||
**Priority:** Medium (3)
|
||||
|
||||
This rule checks for long lines. Please note that comments are not ignored.
|
||||
|
||||
This rule is the PMD equivalent of checkstyle's [LineLength](http://checkstyle.sourceforge.net/config_sizes.html#LineLength) check.
|
||||
|
||||
**This rule is defined by the following Java class:** [net.sourceforge.pmd.lang.plsql.rule.codestyle.LineLengthRule](https://github.com/pmd/pmd/blob/master/pmd-plsql/src/main/java/net/sourceforge/pmd/lang/plsql/rule/codestyle/LineLengthRule.java)
|
||||
|
||||
**This rule has the following properties:**
|
||||
|
||||
|Name|Default Value|Description|Multivalued|
|
||||
|----|-------------|-----------|-----------|
|
||||
|maxLineLength|80|The maximum allowed line length|no|
|
||||
|eachLine|false|Whether to report each line that is longer only the first line|no|
|
||||
|
||||
**Use this rule with the default properties by just referencing it:**
|
||||
``` xml
|
||||
<rule ref="category/plsql/codestyle.xml/LineLength" />
|
||||
```
|
||||
|
||||
**Use this rule and customize it:**
|
||||
``` xml
|
||||
<rule ref="category/plsql/codestyle.xml/LineLength">
|
||||
<properties>
|
||||
<property name="maxLineLength" value="80" />
|
||||
<property name="eachLine" value="false" />
|
||||
</properties>
|
||||
</rule>
|
||||
```
|
||||
|
||||
## MisplacedPragma
|
||||
|
||||
**Since:** PMD 5.5.2
|
||||
|
@ -706,22 +706,22 @@ have more fine grained objects.
|
||||
(
|
||||
count(/descendant::ProgramUnit[
|
||||
not (
|
||||
starts-with(@Image,'get')
|
||||
starts-with(@Name,'get')
|
||||
or
|
||||
starts-with(@Image,'set')
|
||||
starts-with(@Name,'set')
|
||||
or
|
||||
starts-with(@Image,'is')
|
||||
starts-with(@Name,'is')
|
||||
)
|
||||
]
|
||||
)
|
||||
+
|
||||
count(/descendant::TypeMethod[
|
||||
not (
|
||||
starts-with(@Image,'get')
|
||||
starts-with(@Name,'get')
|
||||
or
|
||||
starts-with(@Image,'set')
|
||||
starts-with(@Name,'set')
|
||||
or
|
||||
starts-with(@Image,'is')
|
||||
starts-with(@Name,'is')
|
||||
)
|
||||
]
|
||||
)
|
||||
|
@ -19,13 +19,9 @@ TO_DATE(TO_CHAR(date-variable)) used to remove time component - use TRUNC(date-v
|
||||
|
||||
**This rule is defined by the following XPath expression:**
|
||||
``` xpath
|
||||
//PrimaryExpression
|
||||
[PrimaryPrefix/Name/@Image='TO_DATE']
|
||||
[count(PrimarySuffix/Arguments/ArgumentList/Argument) = 1]
|
||||
[.//PrimaryExpression
|
||||
[PrimaryPrefix/Name/@Image='TO_CHAR']
|
||||
[count(PrimarySuffix/Arguments/ArgumentList/Argument) = 1]
|
||||
]
|
||||
//FunctionCall[@Image='TO_DATE']
|
||||
[count(Arguments/ArgumentList/Argument) = 1]
|
||||
[Arguments/ArgumentList/Argument//FunctionCall[@Image='TO_CHAR']]
|
||||
```
|
||||
|
||||
**Example(s):**
|
||||
@ -61,7 +57,8 @@ TO_DATE without date format- use TO_DATE(expression, date-format)
|
||||
|
||||
**This rule is defined by the following XPath expression:**
|
||||
``` xpath
|
||||
//PrimaryExpression[PrimaryPrefix/Name/@Image='TO_DATE' and count(PrimarySuffix/Arguments/ArgumentList/Argument) = 1 ]
|
||||
//FunctionCall[@Image='TO_DATE']
|
||||
[count(Arguments/ArgumentList/Argument) = 1]
|
||||
```
|
||||
|
||||
**Example(s):**
|
||||
@ -110,7 +107,8 @@ TO_TIMESTAMP without date format- use TO_TIMESTAMP(expression, date-format)
|
||||
|
||||
**This rule is defined by the following XPath expression:**
|
||||
``` xpath
|
||||
//PrimaryExpression[PrimaryPrefix/Name/@Image='TO_TIMESTAMP' and count(PrimarySuffix/Arguments/ArgumentList/Argument) = 1 ]
|
||||
//FunctionCall[@Image='TO_TIMESTAMP']
|
||||
[count(Arguments/ArgumentList/Argument) = 1]
|
||||
```
|
||||
|
||||
**Example(s):**
|
||||
|
Reference in New Issue
Block a user