-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
/
NewlineAtEndOfFileCheck.xml
67 lines (66 loc) · 3 KB
/
NewlineAtEndOfFileCheck.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
<?xml version="1.0" encoding="UTF-8"?>
<checkstyle-metadata>
<module>
<check fully-qualified-name="com.puppycrawl.tools.checkstyle.checks.NewlineAtEndOfFileCheck"
name="NewlineAtEndOfFile"
parent="com.puppycrawl.tools.checkstyle.Checker">
<description><p>
Checks whether files end with a line separator.
</p>
<p>
Rationale: Any source files and text files in general should end with a line
separator to let other easily add new content at the end of file and "diff"
command does not show previous lines as changed.
</p>
<p>
Example (the line with 'No newline at end of file' should not be in the diff):
</p>
<pre>
&#64;&#64; -32,4 +32,5 &#64;&#64; ForbidWildcardAsReturnTypeCheck.returnTypeClassNamesIgnoreRegex
PublicReferenceToPrivateTypeCheck.name = Public Reference To Private Type
StaticMethodCandidateCheck.name = Static Method Candidate
-StaticMethodCandidateCheck.desc = Checks whether private methods should be declared as static.
\ No newline at end of file
+StaticMethodCandidateCheck.desc = Checks whether private methods should be declared as static.
+StaticMethodCandidateCheck.skippedMethods = Method names to skip during the check.
</pre>
<p>
It can also trick the VCS to report the wrong owner for such lines.
An engineer who has added nothing but a newline character becomes the last
known author for the entire line. As a result, a mate can ask him a question
to which he will not give the correct answer.
</p>
<p>
Old Rationale: CVS source control management systems will even print
a warning when it encounters a file that doesn't end with a line separator.
</p>
<p>
Attention: property fileExtensions works with files that are passed by similar
property for at <a href="https://checkstyle.org/config.html#Checker">Checker</a>.
Please make sure required file extensions are mentioned at Checker's fileExtensions property.
</p>
<p>
This will check against the platform-specific default line separator.
</p>
<p>
It is also possible to enforce the use of a specific line-separator across
platforms, with the {@code lineSeparator} property.
</p></description>
<properties>
<property default-value="" name="fileExtensions" type="java.lang.String[]">
<description>Specify the file type extension of the files to check.</description>
</property>
<property default-value="lf_cr_crlf"
name="lineSeparator"
type="com.puppycrawl.tools.checkstyle.checks.LineSeparatorOption">
<description>Specify the type of line separator.</description>
</property>
</properties>
<message-keys>
<message-key key="noNewlineAtEOF"/>
<message-key key="unable.open"/>
<message-key key="wrong.line.end"/>
</message-keys>
</check>
</module>
</checkstyle-metadata>