Skip to content

Commit

Permalink
various code style tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
sindresorhus committed Feb 6, 2015
1 parent 915373a commit 22ef98d
Show file tree
Hide file tree
Showing 8 changed files with 19 additions and 29 deletions.
1 change: 0 additions & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# editorconfig.org
root = true

[*]
Expand Down
6 changes: 0 additions & 6 deletions .npmignore

This file was deleted.

1 change: 0 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,3 @@ node_js:
before_install:
- gem update --system
- gem install sass
- npm install -g grunt-cli
25 changes: 9 additions & 16 deletions Gruntfile.js
Original file line number Diff line number Diff line change
@@ -1,17 +1,6 @@
/*
* grunt-contrib-sass
* http://gruntjs.com/
*
* Copyright (c) 2012 Sindre Sorhus, contributors
* Licensed under the MIT license.
*/
'use strict';

module.exports = function (grunt) {
grunt.initConfig({
pkg: {
name: 'grunt-contrib-sass'
},
jshint: {
options: {
jshintrc: '.jshintrc'
Expand All @@ -29,17 +18,17 @@ module.exports = function (grunt) {
]
},
nodeunit: {
tests: ['test/*_test.js']
tests: ['test/test.js']
},
sass: {
options: {
sourcemap: 'none'
},
compile: {
files: {
'test/tmp/scss.css': ['test/fixtures/compile.scss'],
'test/tmp/sass.css': ['test/fixtures/compile.sass'],
'test/tmp/css.css': ['test/fixtures/compile.css']
'test/tmp/scss.css': 'test/fixtures/compile.scss',
'test/tmp/sass.css': 'test/fixtures/compile.sass',
'test/tmp/css.css': 'test/fixtures/compile.css'
}
},
ignorePartials: {
Expand All @@ -56,7 +45,11 @@ module.exports = function (grunt) {
files: [{
expand: true,
cwd: 'test/fixtures',
src: ['updatetrue.scss', 'updatetrue.sass', 'updatetrue.css'],
src: [
'updatetrue.scss',
'updatetrue.sass',
'updatetrue.css'
],
dest: 'test/tmp',
ext: '.css'
}]
Expand Down
4 changes: 4 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
},
"devDependencies": {
"grunt": "^0.4.5",
"grunt-cli": "^0.1.13",
"grunt-contrib-clean": "^0.6.0",
"grunt-contrib-internal": "^0.4.10",
"grunt-contrib-jshint": "^0.11.0",
Expand All @@ -41,5 +42,8 @@
"compile",
"preprocessor",
"style"
],
"files": [
"tasks"
]
}
4 changes: 2 additions & 2 deletions tasks/lib/check.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
'use strict';

var path = require('path');
var async = require('async');
var chalk = require('chalk');
Expand All @@ -8,6 +7,7 @@ var grunt = require('grunt');

module.exports = function (files, options, cb) {
var failCount = 0;

var filesToCheck = files.filter(function (src) {
return path.basename(src)[0] !== '_' && grunt.file.exists(src);
});
Expand All @@ -27,7 +27,7 @@ module.exports = function (files, options, cb) {
grunt.verbose.writeln('Command: ' + bin + ' ' + args.join(' '));

grunt.verbose.writeln('Checking file ' + chalk.cyan(src) + ' syntax.');
spawn(bin, args, { stdio: 'inherit' })
spawn(bin, args, {stdio: 'inherit'})
.on('error', grunt.warn)
.on('close', function (code) {
if (code > 0) {
Expand Down
7 changes: 4 additions & 3 deletions tasks/sass.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ var checkFilesSyntax = require('./lib/check');
var concurrencyCount = (os.cpus().length || 1) * 2;

module.exports = function (grunt) {
var checkBinary = function (cmd, errMess) {
var checkBinary = function (cmd, errMsg) {
try {
which.sync(cmd);
} catch (err) {
return grunt.warn(
'\n' + errMess + '\n' +
'\n' + errMsg + '\n' +
'More info: https://github.com/gruntjs/grunt-contrib-sass\n'
);
}
Expand Down Expand Up @@ -91,14 +91,15 @@ module.exports = function (grunt) {
var cp = spawn(bin, args, {stdio: 'inherit'});

cp.on('error', grunt.warn);

cp.on('close', function (code) {
if (code > 0) {
grunt.warn('Exited with error code ' + code);
next();
return;
}

grunt.verbose.writeln('File ' + chalk.cyan(file.dest) + ' created.');
grunt.verbose.writeln('File ' + chalk.cyan(file.dest) + ' created');
next();
});
}, cb);
Expand Down
File renamed without changes.

0 comments on commit 22ef98d

Please sign in to comment.