- Timestamp:
- 03/14/14 12:36:58 (11 years ago)
- Location:
- Dev/trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
Dev/trunk
- Property svn:ignore
-
old new 1 1 build 2 quod-erat.git
-
- Property svn:ignore
-
Dev/trunk/node_modules/grunt-coffeelint/tasks/coffeelint.js
r484 r516 4 4 grunt.registerMultiTask('coffeelint', 'Validate files with CoffeeLint', function() { 5 5 6 var errorCount = 0; 7 var warnCount = 0; 6 8 var files = this.filesSrc; 7 9 var options = this.options(); 8 var errorCount = 0; 9 var warnCount = 0; 10 11 if (options.configFile != undefined) { 12 var config = grunt.file.readJSON(options.configFile); 13 options.configFile = undefined; 14 for (var key in options) { 15 config[key] = options[key]; 16 } 17 options = config; 18 } 10 19 11 20 files.forEach(function(file) { 12 21 grunt.verbose.writeln('Linting ' + file + '...'); 13 22 14 var errors = coffeelint.lint(grunt.file.read(file), options); 23 var literate = !!file.match(/\.(litcoffee|coffee\.md)$/i); 24 var errors = coffeelint.lint(grunt.file.read(file), options, literate); 15 25 16 26 if (!errors.length) { … … 40 50 }); 41 51 42 if (errorCount ) {52 if (errorCount && !options.force) { 43 53 return false; 44 54 } 45 55 46 if (!warnCount) { 47 grunt.log.ok(files.length + ' file' + (files.length === 1 ? '' : 's') + 48 ' lint free.'); 56 if (!warnCount && !errorCount) { 57 grunt.log.ok(files.length + ' file' + (files.length === 1 ? '' : 's') + ' lint free.'); 49 58 } 50 59 });
Note: See TracChangeset
for help on using the changeset viewer.