<commit_before>/*
 * grunt-depcheck
 * https://github.com/rumpl/grunt-depcheck
 *
 * Copyright (c) 2015 <NAME>
 * Licensed under the MIT license.
 */

'use strict';

var path = require('path');

module.exports = function (grunt) {
  var depcheck = require('./lib/depcheck').init();

  grunt.registerMultiTask('depcheck', 'Depcheck Grunt plugin', function () {
    var options = this.options({
      'withoutDev': false,
      'failOnUnusedDeps': false,
      'ignoreDirs': ['.git','.svn','.hg','.idea','node_modules','bower_components'],
      'ingoreMatches': []
    });

    var dirsChecked = 0;
    var done = this.async();
    var fail = false;
    var files = this.filesSrc;

    files.forEach(function (f) {
      depcheck.check(path.resolve(f), {
        ignoreDirs: options.ignoreDirs,
        ingoreMatches: options.ingoreMatches,
        withoutDev: options.withoutDev
      }, function (unused) {
        if (unused.dependencies.length !== 0) {
          fail = options.failOnUnusedDeps;
          grunt.log.warn('Unused Dependencies');
          unused.dependencies.forEach(function (u) {
            grunt.log.warn('* ' + u);
          });
        }

        if (unused.devDependencies.length !== 0) {
          fail = options.failOnUnusedDeps;
          grunt.log.warn();
          grunt.log.warn('Unused devDependencies');
          unused.devDependencies.forEach(function (u) {
            grunt.log.warn('* ' + u);
          });
        }

        if (dirsChecked++ === files.length - 1) {
          done(!fail);
        }
      });
    });
  });
};
<commit_msg>pass options directly to depcheck again<commit_after>/*
 * grunt-depcheck
 * https://github.com/rumpl/grunt-depcheck
 *
 * Copyright (c) 2015 <NAME>
 * Licensed under the MIT license.
 */

'use strict';

var path = require('path');

module.exports = function (grunt) {
  var depcheck = require('./lib/depcheck').init();

  grunt.registerMultiTask('depcheck', 'Depcheck Grunt plugin', function () {
    var options = this.options({
      'withoutDev': false,
      'failOnUnusedDeps': false,
      'ignoreDirs': ['.git','.svn','.hg','.idea','node_modules','bower_components'],
      'ingoreMatches': []
    });

    var dirsChecked = 0;
    var done = this.async();
    var fail = false;
    var files = this.filesSrc;

    files.forEach(function (f) {
      depcheck.check(path.resolve(f), options, function (unused) {
        if (unused.dependencies.length !== 0) {
          fail = options.failOnUnusedDeps;
          grunt.log.warn('Unused Dependencies');
          unused.dependencies.forEach(function (u) {
            grunt.log.warn('* ' + u);
          });
        }

        if (unused.devDependencies.length !== 0) {
          fail = options.failOnUnusedDeps;
          grunt.log.warn();
          grunt.log.warn('Unused devDependencies');
          unused.devDependencies.forEach(function (u) {
            grunt.log.warn('* ' + u);
          });
        }

        if (dirsChecked++ === files.length - 1) {
          done(!fail);
        }
      });
    });
  });
};

{'fraction_non_alphanumeric': 0.16094210009813542, 'fraction_numerical': 0.005233889434085705, 'mean_word_length': 2.3239130434782607, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '576112', 'n_tokens_mistral': 982, 'n_tokens_neox': 951, 'n_words': 178}