Skip to content

Commit

Permalink
Merge pull request #17 from bloglovin/update_everything
Browse files Browse the repository at this point in the history
update everything, remove dependencyCheck
  • Loading branch information
JMedoy committed Mar 23, 2017
2 parents bc173a8 + b0540c2 commit 2f4cf82
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 37 deletions.
27 changes: 6 additions & 21 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ var lib = {
var _ = require('lodash');

exports.initConfig = function (grunt, config, options) {
var defaults, plugins, testTasks, integrationTestTasks, cwd;
config = config || {};
options = options || {};

Expand All @@ -25,14 +26,13 @@ exports.initConfig = function (grunt, config, options) {
}

// Default task options
var defaults = {
defaults = {
pkg: grunt.file.readJSON('package.json'),
jshint: {
files: _.union([
'*.js',
'lib/**/*.js',
'test/**/*.js',
'bin/**/*.js',
'cli/**/*.js',
'tasks/**/*.js',
], options.jsFiles || []),
Expand All @@ -59,16 +59,6 @@ exports.initConfig = function (grunt, config, options) {
}),
};

if (!options.noDependencyCheck) {
defaults['dependency-check'] = {
files: _.union(['<%= jshint.files %>'], options.dependencyFiles || []),
options: {
excludeUnusedDev: true,
ignoreUnused: options.ignoreUnusedDependencies || [],
}
};
}

if (!options.noMocha) {
defaults.mocha_istanbul = {
options: {
Expand All @@ -94,26 +84,21 @@ exports.initConfig = function (grunt, config, options) {
_.defaults(config, defaults);
grunt.initConfig(config);

var plugins = [
plugins = [
'grunt-notify',
'grunt-lintspaces',
'grunt-contrib-jshint',
'grunt-contrib-watch',
];

var testTasks = ['lintspaces', 'jshint', 'setTestEnv'];
var integrationTestTasks = options.noIntegration ? ['test'] : ['test', 'mocha_istanbul:integration'];
testTasks = ['lintspaces', 'jshint', 'setTestEnv'];
integrationTestTasks = options.noIntegration ? ['test'] : ['test', 'mocha_istanbul:integration'];

if (!options.noJSCS) {
plugins.push('grunt-jscs');
testTasks.push('jscs');
}

if (!options.noDependencyCheck) {
plugins.push('dependency-check');
testTasks.push('dependency-check');
}

if (!options.noMocha) {
plugins.push('grunt-mocha-istanbul');
testTasks.push('mocha_istanbul:basic');
Expand All @@ -123,7 +108,7 @@ exports.initConfig = function (grunt, config, options) {
integrationTestTasks = integrationTestTasks.concat(options.extraTestAllTasks || []);

// Uhm, HACK! But WTF Grunt!
var cwd = process.cwd();
cwd = process.cwd();
process.chdir(__dirname);
// Manually load the plugins so that we don't pollute the parent module
// with loads of peer dependencies.
Expand Down
32 changes: 17 additions & 15 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,27 +18,29 @@
},
"homepage": "https://github.com/bloglovin/lintlovin",
"dependencies": {
"dependency-check": "^2.1.0",
"grunt-contrib-jshint": "~0.11.0",
"grunt-contrib-watch": "~0.6.1",
"grunt-jscs": "^1.2.0",
"grunt-lintspaces": "~0.6.0",
"grunt-mocha-istanbul": "^2.1.0",
"dependency-check": "^2.8.0",
"grunt-contrib-jshint": "~1.1.0",
"grunt-contrib-watch": "~1.0.0",
"grunt-dependency-check": "^1.1.0",
"grunt-jscs": "^3.0.1",
"grunt-lintspaces": "~0.8.1",
"grunt-mocha-istanbul": "^5.0.2",
"grunt-notify": ">=0.3.1 <0.5.0",
"lodash": "^3.0.0",
"lodash": "^4.17.4",
"time-grunt": "^1.0.0"
},
"peerDependencies": {
"grunt": "~0.4.5",
"husky": ">=0.6.1 <0.8.0",
"istanbul": "~0.3.0",
"mocha": ">=1.21.4-0 <3.0.0-0"
"grunt": "~1.0.1",
"husky": "~0.13.2",
"mocha": "^3.2.0",
"istanbul": "~0.3.0"
},
"devDependencies": {
"chai": "^2.0.0",
"grunt": "~0.4.5",
"husky": "~0.7.0",
"chai": "^3.5.0",
"grunt": "~1.0.1",
"husky": "~0.13.2",
"js-yaml": "^3.2.1",
"mocha": ">=1.21.4-0 <3.0.0-0"
"mocha": "^3.2.0",
"istanbul": "~0.3.0"
}
}
3 changes: 2 additions & 1 deletion test/docs.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,11 @@ suite('README', function testClient() {
var jshintOptions = JSON.parse(jshintrc);

var yamlBlock = yaml.exec(readme);
var documentedOptions;
if (!yamlBlock) {
throw new Error('No yaml code block in the readme');
}
var documentedOptions = lib.jsYaml.safeLoad(yamlBlock[1]);
documentedOptions = lib.jsYaml.safeLoad(yamlBlock[1]);

expect(documentedOptions).to.deep.equal(jshintOptions);
done();
Expand Down

0 comments on commit 2f4cf82

Please sign in to comment.