Skip to content

Commit f13091c

Browse files
committed
ensure that there's only one blank line in .json and .glsl files
1 parent f91052f commit f13091c

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

tasks/test_syntax.js

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,8 @@ function assertTrailingNewLine() {
136136
path.join(constants.pathToRoot, 'test', 'image', 'mocks', '*')
137137
]);
138138

139-
var regex = /\r?\n$/;
139+
var regexNewLine = /\r?\n$/;
140+
var regexEmptyNewLine = /^\r?\n$/;
140141
var promises = [];
141142
var logs = [];
142143

@@ -147,11 +148,16 @@ function assertTrailingNewLine() {
147148
promises.push(promise);
148149

149150
promise.then(function(lines) {
150-
if(!regex.test(lines)) {
151+
if(!regexNewLine.test(lines)) {
151152
logs.push([
152153
file, ':',
153154
'does not have a trailing new line character'
154155
].join(' '));
156+
} else if(regexEmptyNewLine.test(lines)) {
157+
logs.push([
158+
file, ':',
159+
'has more than one trailing new line'
160+
].join(' '));
155161
}
156162
});
157163
});

0 commit comments

Comments
 (0)