Merge pull request #13 from kemitix/detect-sync-conflicts
RegexpOnFilename: Add a new rule to detect if there are any sync conflict files
This commit is contained in:
commit
e24f77f3fc
8 changed files with 67 additions and 5 deletions
17
README.md
17
README.md
|
@ -219,6 +219,7 @@ Rule|Level|Source|Enabled|Suppressable
|
||||||
[Regexp](#regexp)|unspecified|checkstyle||
|
[Regexp](#regexp)|unspecified|checkstyle||
|
||||||
[RegexpHeader](#regexpheader)|unspecified|checkstyle||
|
[RegexpHeader](#regexpheader)|unspecified|checkstyle||
|
||||||
[RegexpMultiline](#regexpmultiline)|unspecified|checkstyle||
|
[RegexpMultiline](#regexpmultiline)|unspecified|checkstyle||
|
||||||
|
[RegexpOnFilename](#regexponfilename)|layout|checkstyle|Yes|
|
||||||
[RegexpOnFilename](#regexponfilename)|unspecified|checkstyle||
|
[RegexpOnFilename](#regexponfilename)|unspecified|checkstyle||
|
||||||
[RegexpSingleline](#regexpsingleline)|unspecified|checkstyle||
|
[RegexpSingleline](#regexpsingleline)|unspecified|checkstyle||
|
||||||
[RegexpSinglelineJava](#regexpsinglelinejava)|unspecified|checkstyle||
|
[RegexpSinglelineJava](#regexpsinglelinejava)|unspecified|checkstyle||
|
||||||
|
@ -274,6 +275,22 @@ The following is a list of each of the checks and the expectations each has on y
|
||||||
|
|
||||||
Rules are listed in alphabetical order.
|
Rules are listed in alphabetical order.
|
||||||
|
|
||||||
|
#### [RegexpOnFilename](http://checkstyle.sourceforge.net/config_regexp.html#RegexpOnFilename)
|
||||||
|
|
||||||
|
Checks for the existence of forbidden java file names.
|
||||||
|
|
||||||
|
File names are forbidden if they match the pattern `(.sync-conflict-| conflicted copy )`.
|
||||||
|
|
||||||
|
N.B. only `*.java` files are checked.
|
||||||
|
|
||||||
|
This check is intended to detect Syncthing and Dropbox conflict files.
|
||||||
|
|
||||||
|
e.g.
|
||||||
|
````
|
||||||
|
DataClass (Bob's conflicted copy 2017-03-11).java
|
||||||
|
DataClass.sync-conflict-20170311-1648.java
|
||||||
|
````
|
||||||
|
|
||||||
#### [AbbreviationAsWordInName](http://checkstyle.sourceforge.net/config_naming.html#AbbreviationAsWordInName)
|
#### [AbbreviationAsWordInName](http://checkstyle.sourceforge.net/config_naming.html#AbbreviationAsWordInName)
|
||||||
|
|
||||||
Enforces proper `CamelCase` and avoids sequences of consecutive uppercase characters in identifiers. Does not apply to @Overridden methods.
|
Enforces proper `CamelCase` and avoids sequences of consecutive uppercase characters in identifiers. Does not apply to @Overridden methods.
|
||||||
|
|
|
@ -12,6 +12,16 @@ template:
|
||||||
readme-template: builder/src/main/resources/README-template.md
|
readme-template: builder/src/main/resources/README-template.md
|
||||||
readme-fragments: builder/src/main/resources/rules
|
readme-fragments: builder/src/main/resources/rules
|
||||||
rules:
|
rules:
|
||||||
|
-
|
||||||
|
name: RegexpOnFilename
|
||||||
|
parent: CHECKER
|
||||||
|
level: LAYOUT
|
||||||
|
enabled: true
|
||||||
|
source: CHECKSTYLE
|
||||||
|
uri: http://checkstyle.sourceforge.net/config_regexp.html#RegexpOnFilename
|
||||||
|
properties:
|
||||||
|
fileNamePattern: "(.sync-conflict-| conflicted copy )"
|
||||||
|
match: true
|
||||||
-
|
-
|
||||||
name: AbbreviationAsWordInName
|
name: AbbreviationAsWordInName
|
||||||
parent: TREEWALKER
|
parent: TREEWALKER
|
||||||
|
|
15
builder/src/main/resources/rules/RegexpOnFilename.md
Normal file
15
builder/src/main/resources/rules/RegexpOnFilename.md
Normal file
|
@ -0,0 +1,15 @@
|
||||||
|
|
||||||
|
Checks for the existence of forbidden java file names.
|
||||||
|
|
||||||
|
File names are forbidden if they match the pattern `(.sync-conflict-| conflicted copy )`.
|
||||||
|
|
||||||
|
N.B. only `*.java` files are checked.
|
||||||
|
|
||||||
|
This check is intended to detect Syncthing and Dropbox conflict files.
|
||||||
|
|
||||||
|
e.g.
|
||||||
|
````
|
||||||
|
DataClass (Bob's conflicted copy 2017-03-11).java
|
||||||
|
DataClass.sync-conflict-20170311-1648.java
|
||||||
|
````
|
||||||
|
|
|
@ -4,7 +4,11 @@
|
||||||
"http://www.puppycrawl.com/dtds/configuration_1_3.dtd">
|
"http://www.puppycrawl.com/dtds/configuration_1_3.dtd">
|
||||||
<module name="Checker">
|
<module name="Checker">
|
||||||
|
|
||||||
<module name="FileTabCharacter"/>
|
<module name="RegexpOnFilename">
|
||||||
|
<property name="fileNamePattern" value="(.sync-conflict-| conflicted copy )"/>
|
||||||
|
<property name="match" value="true"/>
|
||||||
|
</module>
|
||||||
|
<module name="FileTabCharacter"/>
|
||||||
<module name="Header">
|
<module name="Header">
|
||||||
<property name="fileExtensions" value="java"/>
|
<property name="fileExtensions" value="java"/>
|
||||||
<property name="headerFile" value="LICENSE.txt"/>
|
<property name="headerFile" value="LICENSE.txt"/>
|
||||||
|
|
|
@ -4,7 +4,11 @@
|
||||||
"http://www.puppycrawl.com/dtds/configuration_1_3.dtd">
|
"http://www.puppycrawl.com/dtds/configuration_1_3.dtd">
|
||||||
<module name="Checker">
|
<module name="Checker">
|
||||||
|
|
||||||
<module name="FileTabCharacter"/>
|
<module name="RegexpOnFilename">
|
||||||
|
<property name="fileNamePattern" value="(.sync-conflict-| conflicted copy )"/>
|
||||||
|
<property name="match" value="true"/>
|
||||||
|
</module>
|
||||||
|
<module name="FileTabCharacter"/>
|
||||||
<module name="Header">
|
<module name="Header">
|
||||||
<property name="fileExtensions" value="java"/>
|
<property name="fileExtensions" value="java"/>
|
||||||
<property name="headerFile" value="LICENSE.txt"/>
|
<property name="headerFile" value="LICENSE.txt"/>
|
||||||
|
|
|
@ -4,7 +4,11 @@
|
||||||
"http://www.puppycrawl.com/dtds/configuration_1_3.dtd">
|
"http://www.puppycrawl.com/dtds/configuration_1_3.dtd">
|
||||||
<module name="Checker">
|
<module name="Checker">
|
||||||
|
|
||||||
<module name="FileTabCharacter"/>
|
<module name="RegexpOnFilename">
|
||||||
|
<property name="fileNamePattern" value="(.sync-conflict-| conflicted copy )"/>
|
||||||
|
<property name="match" value="true"/>
|
||||||
|
</module>
|
||||||
|
<module name="FileTabCharacter"/>
|
||||||
<module name="Header">
|
<module name="Header">
|
||||||
<property name="fileExtensions" value="java"/>
|
<property name="fileExtensions" value="java"/>
|
||||||
<property name="headerFile" value="LICENSE.txt"/>
|
<property name="headerFile" value="LICENSE.txt"/>
|
||||||
|
|
|
@ -4,7 +4,11 @@
|
||||||
"http://www.puppycrawl.com/dtds/configuration_1_3.dtd">
|
"http://www.puppycrawl.com/dtds/configuration_1_3.dtd">
|
||||||
<module name="Checker">
|
<module name="Checker">
|
||||||
|
|
||||||
<module name="FileTabCharacter"/>
|
<module name="RegexpOnFilename">
|
||||||
|
<property name="fileNamePattern" value="(.sync-conflict-| conflicted copy )"/>
|
||||||
|
<property name="match" value="true"/>
|
||||||
|
</module>
|
||||||
|
<module name="FileTabCharacter"/>
|
||||||
<module name="Header">
|
<module name="Header">
|
||||||
<property name="fileExtensions" value="java"/>
|
<property name="fileExtensions" value="java"/>
|
||||||
<property name="headerFile" value="LICENSE.txt"/>
|
<property name="headerFile" value="LICENSE.txt"/>
|
||||||
|
|
|
@ -4,7 +4,11 @@
|
||||||
"http://www.puppycrawl.com/dtds/configuration_1_3.dtd">
|
"http://www.puppycrawl.com/dtds/configuration_1_3.dtd">
|
||||||
<module name="Checker">
|
<module name="Checker">
|
||||||
|
|
||||||
<module name="FileLength"/>
|
<module name="RegexpOnFilename">
|
||||||
|
<property name="fileNamePattern" value="(.sync-conflict-| conflicted copy )"/>
|
||||||
|
<property name="match" value="true"/>
|
||||||
|
</module>
|
||||||
|
<module name="FileLength"/>
|
||||||
<module name="FileTabCharacter"/>
|
<module name="FileTabCharacter"/>
|
||||||
<module name="Header">
|
<module name="Header">
|
||||||
<property name="fileExtensions" value="java"/>
|
<property name="fileExtensions" value="java"/>
|
||||||
|
|
Loading…
Reference in a new issue