Skip to content

Commit

Permalink
style: a bit of formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
vojtajina committed Jul 1, 2013
1 parent c3faa02 commit 9188593
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 25 deletions.
6 changes: 3 additions & 3 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ module.exports = function(grunt) {
// global options
options: {
indentation: {
value: 4,
level: 'warn'
}
value: 4,
level: 'warn'
}
},

// a target that overrides default options
Expand Down
46 changes: 24 additions & 22 deletions tasks/coffeelint.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,36 +14,38 @@ module.exports = function(grunt) {
var errors = coffeelint.lint(grunt.file.read(file), options);

if (!errors.length) {
grunt.verbose.ok();
} else {
errors.forEach(function(error) {
var status, message;

if (error.level === 'error') {
errorCount += 1;
status = "[error]".red;
} else if (error.level === 'warn') {
warnCount += 1;
status = "[warn]".yellow;
} else {
return;
}

message = file + ':' + error.lineNumber + ' ' + error.message + ' (' + error.rule + ')';

grunt.log.writeln(status + ' ' + message);

grunt.event.emit('coffeelint:' + error.level, error.level, message);
grunt.event.emit('coffeelint:any', error.level, message); });
return grunt.verbose.ok();
}

errors.forEach(function(error) {
var status, message;

if (error.level === 'error') {
errorCount += 1;
status = "[error]".red;
} else if (error.level === 'warn') {
warnCount += 1;
status = "[warn]".yellow;
} else {
return;
}

message = file + ':' + error.lineNumber + ' ' + error.message +
' (' + error.rule + ')';

grunt.log.writeln(status + ' ' + message);
grunt.event.emit('coffeelint:' + error.level, error.level, message);
grunt.event.emit('coffeelint:any', error.level, message);
});
});

if (errorCount) {
return false;
}

if (!warnCount) {
grunt.log.ok(files.length + ' file' + (files.length === 1 ? '' : 's') + ' lint free.');
grunt.log.ok(files.length + ' file' + (files.length === 1 ? '' : 's') +
' lint free.');
}
});
};

0 comments on commit 9188593

Please sign in to comment.