<commit_before>'use strict';

module.exports = function (grunt) {
  grunt.initConfig({
    pkg: grunt.file.readJSON('package.json'),

    jshint: {
      all: {
        src: ['Gruntfile.js', 'generators/**/*.js', 'test/*.js']
      },
      options: {
        jshintrc: true,
        force: true,
        reporter: require('jshint-stylish')
      }
    },

    test: {
      all: {
        src: ['test/test-*.js']
      },
      app: {
        src: ['test/test-app.js']
      },
      endpoint: {
        src: ['test/test-endpoint.js']
      },
      model: {
        src: ['test/test-model.js']
      },
      schema: {
        src: ['test/test-schema.js']
      },
      options: {
        reporter: 'nyan'
      }
    },

    watch: {
      scripts: {
        files: ['Gruntfile.js', 'generators/**/*.js', 'test/*.js'],
        tasks: ['jshint:all'],
        options: {
          spawn: false
        }
      },
      tests: {
        files: ['test/*.js'],
        tasks: ['newer:test:all']
      },
      app: {
        files: ['generators/app/**/*.js'],
        tasks: ['test:app']
      },
      endpoint: {
        files: ['generators/endpoint/**/*.js'],
        tasks: ['test:endpoint']
      },
      model: {
        files: ['generators/model/**/*.js'],
        tasks: ['test:model']
      },
      schema: {
        files: ['generators/schema/**/*.js'],
        tasks: ['test:schema']
      }
    },

    clean: {
      coverage: {
        src: ['test/coverage/']
      }
    },

    mocha_istanbul: {
      coverage: {
        src: 'test',
        options: {
          coverageFolder: 'test/coverage',
          mask: 'test-*.js',
          reporter: 'nyan'
        }
      }
    },

    coveralls: {
      coverage: {
        src: 'test/coverage/lcov.info'
      },
      options: {
        force: true
      }
    }
  });

  // Ordinarily this would be handled with newer, but it seems to be a little
  // borked with jshint right now. ¯\(°_o)/¯
  grunt.event.on('watch', function(action, filepath) {
    grunt.config('jshint.all.src', filepath);
  });

  grunt.loadNpmTasks('grunt-contrib-clean');
  grunt.loadNpmTasks('grunt-contrib-jshint');
  grunt.loadNpmTasks('grunt-contrib-watch');
  grunt.loadNpmTasks('grunt-coveralls');
  grunt.loadNpmTasks('grunt-mocha-istanbul');
  grunt.loadNpmTasks('grunt-mocha-test');
  grunt.loadNpmTasks('grunt-newer');

  grunt.renameTask('mochaTest', 'test');

  grunt.registerTask('default', ['jshint:all', 'test:all']);
  grunt.registerTask('cover', ['clean:coverage', 'mocha_istanbul']);
  // Travis >> Coveralls
  grunt.registerTask('ci', ['mocha_istanbul', 'coveralls']);
};
<commit_msg>Change reporting style for coverage reports.<commit_after>'use strict';

module.exports = function (grunt) {
  grunt.initConfig({
    pkg: grunt.file.readJSON('package.json'),

    jshint: {
      all: {
        src: ['Gruntfile.js', 'generators/**/*.js', 'test/*.js']
      },
      options: {
        jshintrc: true,
        force: true,
        reporter: require('jshint-stylish')
      }
    },

    test: {
      all: {
        src: ['test/test-*.js']
      },
      app: {
        src: ['test/test-app.js']
      },
      endpoint: {
        src: ['test/test-endpoint.js']
      },
      model: {
        src: ['test/test-model.js']
      },
      schema: {
        src: ['test/test-schema.js']
      },
      options: {
        reporter: 'nyan'
      }
    },

    watch: {
      scripts: {
        files: ['Gruntfile.js', 'generators/**/*.js', 'test/*.js'],
        tasks: ['jshint:all'],
        options: {
          spawn: false
        }
      },
      tests: {
        files: ['test/*.js'],
        tasks: ['newer:test:all']
      },
      app: {
        files: ['generators/app/**/*.js'],
        tasks: ['test:app']
      },
      endpoint: {
        files: ['generators/endpoint/**/*.js'],
        tasks: ['test:endpoint']
      },
      model: {
        files: ['generators/model/**/*.js'],
        tasks: ['test:model']
      },
      schema: {
        files: ['generators/schema/**/*.js'],
        tasks: ['test:schema']
      }
    },

    clean: {
      coverage: {
        src: ['test/coverage/']
      }
    },

    mocha_istanbul: {
      coverage: {
        src: 'test',
        options: {
          coverageFolder: 'test/coverage',
          mask: 'test-*.js',
          print: 'both',
          reporter: 'spec'
        }
      }
    },

    coveralls: {
      coverage: {
        src: 'test/coverage/lcov.info'
      },
      options: {
        force: true
      }
    }
  });

  // Ordinarily this would be handled with newer, but it seems to be a little
  // borked with jshint right now. ¯\(°_o)/¯
  grunt.event.on('watch', function(action, filepath) {
    grunt.config('jshint.all.src', filepath);
  });

  grunt.loadNpmTasks('grunt-contrib-clean');
  grunt.loadNpmTasks('grunt-contrib-jshint');
  grunt.loadNpmTasks('grunt-contrib-watch');
  grunt.loadNpmTasks('grunt-coveralls');
  grunt.loadNpmTasks('grunt-mocha-istanbul');
  grunt.loadNpmTasks('grunt-mocha-test');
  grunt.loadNpmTasks('grunt-newer');

  grunt.renameTask('mochaTest', 'test');

  grunt.registerTask('default', ['jshint:all', 'test:all']);
  grunt.registerTask('cover', ['clean:coverage', 'mocha_istanbul']);
  // Travis >> Coveralls
  grunt.registerTask('ci', ['mocha_istanbul', 'coveralls']);
};

{'fraction_non_alphanumeric': 0.18806137724550898, 'fraction_numerical': 0.0, 'mean_word_length': 1.9384277075316108, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, 'https://': 0, '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': '4171328', 'n_tokens_mistral': 1860, 'n_tokens_neox': 1841, 'n_words': 293}