forked from checkstyle/checkstyle
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Issue checkstyle#13345: Enable examples tests for RecordComponentName…
…Check
- Loading branch information
1 parent
866552a
commit 943163d
Showing
7 changed files
with
73 additions
and
50 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 19 additions & 0 deletions
19
...ompilable/com/puppycrawl/tools/checkstyle/checks/naming/recordcomponentname/Example1.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
/*xml | ||
<module name="Checker"> | ||
<module name="TreeWalker"> | ||
<module name="RecordComponentName"/> | ||
</module> | ||
</module> | ||
*/ | ||
//non-compiled with javac: Compilable with Java17 | ||
package com.puppycrawl.tools.checkstyle.checks.naming.recordcomponentname; | ||
|
||
// xdoc section -- start | ||
class Example1 { | ||
record Rec1(int other) {} | ||
|
||
record Rec2(String Values) {} // violation, Name must match '^[a-z][a-zA-Z0-9]*$' | ||
|
||
record Rec3(double myNumber) {} | ||
} | ||
// xdoc section -- end |
21 changes: 21 additions & 0 deletions
21
...ompilable/com/puppycrawl/tools/checkstyle/checks/naming/recordcomponentname/Example2.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
/*xml | ||
<module name="Checker"> | ||
<module name="TreeWalker"> | ||
<module name="RecordComponentName"> | ||
<property name="format" value="^[a-z]+$"/> | ||
</module> | ||
</module> | ||
</module> | ||
*/ | ||
//non-compiled with javac: Compilable with Java17 | ||
package com.puppycrawl.tools.checkstyle.checks.naming.recordcomponentname; | ||
|
||
// xdoc section -- start | ||
class Example2 { | ||
record Rec1(int other) {} | ||
|
||
record Rec2(String Values) {} // violation, Name must match '^[a-z]+$' | ||
|
||
record Rec3(double myNumber) {} // violation, Name must match '^[a-z]+$' | ||
} | ||
// xdoc section -- end |
15 changes: 0 additions & 15 deletions
15
.../resources/com/puppycrawl/tools/checkstyle/checks/naming/recordcomponentname/Example1.txt
This file was deleted.
Oops, something went wrong.
16 changes: 0 additions & 16 deletions
16
.../resources/com/puppycrawl/tools/checkstyle/checks/naming/recordcomponentname/Example2.txt
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters