File tree Expand file tree Collapse file tree 5 files changed +27
-0
lines changed Expand file tree Collapse file tree 5 files changed +27
-0
lines changed Original file line number Diff line number Diff line change @@ -64,6 +64,7 @@ def check
64
64
errors [ doc ] << "missing or invalid lang variable" if doc . lang_invalid?
65
65
errors [ doc ] << "lang variable not matching file location" if doc . lang_not_matching_filename?
66
66
errors [ doc ] << "no newline at end of file" if doc . no_newline_at_eof?
67
+ errors [ doc ] << "blank line(s) at end of file" if doc . blank_line_at_eof?
67
68
errors [ doc ] << "wrong line breaks (CR/LF)" if doc . crlf_line_breaks?
68
69
69
70
unless WHITESPACE_EXCLUSIONS . include? ( doc . filename )
Original file line number Diff line number Diff line change @@ -91,6 +91,10 @@ def no_newline_at_eof?
91
91
!content . end_with? ( "\n " )
92
92
end
93
93
94
+ def blank_line_at_eof?
95
+ content . end_with? ( "\n \n " )
96
+ end
97
+
94
98
def trailing_whitespace?
95
99
content . match? ( / $/ )
96
100
end
Original file line number Diff line number Diff line change
1
+ ---
2
+ layout : page
3
+ title : " Page"
4
+ lang : en
5
+ ---
6
+
7
+ Content
8
+
Original file line number Diff line number Diff line change
1
+ ---
2
+ layout : page
3
+ title : " Page"
4
+ lang : en
5
+ ---
6
+
7
+ Content
8
+
9
+
10
+
Original file line number Diff line number Diff line change @@ -20,6 +20,10 @@ en/09_lang_variable_wrong.md
20
20
en/10_multiple_errors.md
21
21
missing or invalid lang variable
22
22
trailing whitespace
23
+ en/11_blank_line_at_eof.md
24
+ blank line(s) at end of file
25
+ en/12_blank_lines_at_eof.md
26
+ blank line(s) at end of file
23
27
en/_posts/2000-01-01-old-lang-variable-nil.md
24
28
missing or invalid lang variable
25
29
en/_posts/2000-01-02-old-translator-variable-wrong-type.md
You can’t perform that action at this time.
0 commit comments