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 NewlineAtEndOfFile
- Loading branch information
Showing
14 changed files
with
169 additions
and
108 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
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
11 changes: 11 additions & 0 deletions
11
...xamples/resources/com/puppycrawl/tools/checkstyle/checks/newlineatendoffile/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,11 @@ | ||
/*xml | ||
<module name="Checker"> | ||
<module name="NewlineAtEndOfFile"/> | ||
</module> | ||
*/ | ||
package com.puppycrawl.tools.checkstyle.checks.newlineatendoffile; | ||
// xdoc section -- start | ||
public class Example1 { // ⤶ | ||
// ⤶ | ||
} // ⤶ // ok, file ends with a new line. | ||
// xdoc section -- end |
18 changes: 0 additions & 18 deletions
18
...examples/resources/com/puppycrawl/tools/checkstyle/checks/newlineatendoffile/Example1.txt
This file was deleted.
Oops, something went wrong.
12 changes: 12 additions & 0 deletions
12
...xamples/resources/com/puppycrawl/tools/checkstyle/checks/newlineatendoffile/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,12 @@ | ||
/*xml | ||
<module name="Checker"> | ||
<module name="NewlineAtEndOfFile"/> | ||
</module> | ||
*/ | ||
// violation 5 lines above 'File does not end with a newline.' | ||
package com.puppycrawl.tools.checkstyle.checks.newlineatendoffile; | ||
// xdoc section -- start | ||
public class Example2 { // ⤶ | ||
// ⤶ | ||
} // no ⤶ below it is violation | ||
// xdoc section -- end |
20 changes: 0 additions & 20 deletions
20
...examples/resources/com/puppycrawl/tools/checkstyle/checks/newlineatendoffile/Example2.txt
This file was deleted.
Oops, something went wrong.
13 changes: 13 additions & 0 deletions
13
...xamples/resources/com/puppycrawl/tools/checkstyle/checks/newlineatendoffile/Example3.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,13 @@ | ||
/*xml | ||
<module name="Checker"> | ||
<module name="NewlineAtEndOfFile"> | ||
<property name="lineSeparator" value="lf"/> | ||
</module> | ||
</module> | ||
*/ | ||
// violation 7 lines above 'ending for file is LF(\\n), but CRLF(\\r\\n) is' | ||
package com.puppycrawl.tools.checkstyle.checks.newlineatendoffile; | ||
// xdoc section -- start | ||
public class Example3 { // ⤶ | ||
} // ␍⤶ it is violation as line ending is different from expected | ||
// xdoc section -- end |
19 changes: 0 additions & 19 deletions
19
...examples/resources/com/puppycrawl/tools/checkstyle/checks/newlineatendoffile/Example3.txt
This file was deleted.
Oops, something went wrong.
12 changes: 12 additions & 0 deletions
12
...-examples/resources/com/puppycrawl/tools/checkstyle/checks/newlineatendoffile/Example4.py
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,12 @@ | ||
/*xml | ||
<module name="Checker"> | ||
<module name="NewlineAtEndOfFile"> | ||
<property name="fileExtensions" value="java, xml, py"/> | ||
</module> | ||
</module> | ||
*/ | ||
// violation 7 lines above 'File does not end with a newline.' | ||
// xdoc section -- start | ||
print("Hello world!") | ||
# no ⤶ below it is violation | ||
// xdoc section -- end |
12 changes: 12 additions & 0 deletions
12
...xamples/resources/com/puppycrawl/tools/checkstyle/checks/newlineatendoffile/Example5.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,12 @@ | ||
/*xml | ||
<module name="Checker"> | ||
<module name="NewlineAtEndOfFile"/> | ||
</module> | ||
*/ | ||
// violation 5 lines above 'File does not end with a newline.' | ||
package com.puppycrawl.tools.checkstyle.checks.newlineatendoffile; | ||
// xdoc section -- start | ||
public class Example5 { // ⤶ | ||
// ⤶ | ||
} // no ⤶ below it is violation | ||
// xdoc section -- end |
10 changes: 10 additions & 0 deletions
10
...examples/resources/com/puppycrawl/tools/checkstyle/checks/newlineatendoffile/Example6.txt
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,10 @@ | ||
/*xml | ||
<module name="Checker"> | ||
<module name="NewlineAtEndOfFile"> | ||
<property name="fileExtensions" value="java, xml, py"/> | ||
</module> | ||
</module> | ||
*/ | ||
// xdoc section -- start | ||
Sample txt file. // ok, this file is not specified in the config. | ||
// xdoc section -- end |
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