()
| 218 | |
| 219 | // check that all files have a trailing new line character |
| 220 | function assertTrailingNewLine() { |
| 221 | var pattern = combineGlobs([ |
| 222 | path.join(constants.pathToSrc, '**/*.glsl'), |
| 223 | path.join(constants.pathToRoot, 'test', 'image', 'mocks', '*') |
| 224 | ]); |
| 225 | |
| 226 | var regexNewLine = /\r?\n$/; |
| 227 | var regexEmptyNewLine = /^\r?\n$/; |
| 228 | var promises = []; |
| 229 | var logs = []; |
| 230 | |
| 231 | glob(pattern).then((files) => { |
| 232 | files.forEach(function(file) { |
| 233 | var promise = readLastLines.read(file, 1); |
| 234 | |
| 235 | promises.push(promise); |
| 236 | |
| 237 | promise.then(function(lines) { |
| 238 | if(!regexNewLine.test(lines)) { |
| 239 | logs.push([ |
| 240 | file, ':', |
| 241 | 'does not have a trailing new line character' |
| 242 | ].join(' ')); |
| 243 | } else if(regexEmptyNewLine.test(lines)) { |
| 244 | logs.push([ |
| 245 | file, ':', |
| 246 | 'has more than one trailing new line' |
| 247 | ].join(' ')); |
| 248 | } |
| 249 | }); |
| 250 | }); |
| 251 | |
| 252 | Promise.all(promises).then(function() { |
| 253 | log('trailing new line character', logs); |
| 254 | }); |
| 255 | }); |
| 256 | } |
| 257 | |
| 258 | // check circular dependencies |
| 259 | function assertCircularDeps() { |
no test coverage detected
searching dependent graphs…