<commit_before>const yeoman = require('yeoman-generator');
const yosay = require('yosay');
const _merge = require('lodash/merge');
const _includes = require('lodash/includes');

module.exports = yeoman.Base.extend({
  prompting: {
    taskrunner() {
      const self = this;

      this.log(yosay(
        'Configure Task Runner for Grunt'
      ));
      return this.prompt([{
        type: 'checkbox',
        name: 'selectedTaskRunner',
        message: 'Which Task Runner do you use?',
        choices: ['Grunt'],
        default: ['Grunt'],
        when: () => !self.config.get('selectedTaskRunner'),
      }])
      .then(answers => {
        self.selectedTaskRunner = self.config.get('selectedTaskRunner') ||
        answers.selectedTaskRunner;
      });
    },
  },
  writing() {
    // Read a package.json if it exists or create it
    const packageJSON = this.fs.readJSON(this.destinationPath('package.json'), {});
    // Task Runner
    if (_includes(this.selectedTaskRunner, 'Grunt')) {
      this.log('Configuring Gruntfile for Task Runner');
      _merge(packageJSON, {
        devDependencies: {
          grunt: '^1.0.1',
          'load-grunt-config': '^0.19.2',
        },
      });
      this.fs.copyTpl(
        this.templatePath('grunt/aliases.js'),
        this.destinationPath('./grunt/aliases.js'), {}
      );
      this.fs.copyTpl(
        this.templatePath('Gruntfile.js'),
        this.destinationPath('./Gruntfile.js'), {}
      );
    }
    this.log('Writing to package.json');
    this.fs.writeJSON(this.destinationPath('package.json'), packageJSON);
    this.installDependencies();
  },
});<commit_msg>resolve review issue<commit_after>const yeoman = require('yeoman-generator');
const yosay = require('yosay');
const _merge = require('lodash/merge');
const _includes = require('lodash/includes');

module.exports = yeoman.Base.extend({
  prompting: {
    taskrunner() {
      const self = this;

      this.log(yosay(
        'Configure Task Runner'
      ));
      return this.prompt([{
        type: 'checkbox',
        name: 'selectedTaskRunner',
        message: 'Which Task Runner do you want to configure?',
        choices: ['Grunt'],
        default: ['Grunt'],
        when: () => !self.config.get('selectedTaskRunner'),
      }])
      .then(answers => {
        self.selectedTaskRunner = self.config.get('selectedTaskRunner') ||
        answers.selectedTaskRunner;
      });
    },
  },
  writing() {
    // Read a package.json if it exists or create it
    const packageJSON = this.fs.readJSON(this.destinationPath('package.json'), {});
    if (_includes(this.selectedTaskRunner, 'Grunt')) {
      this.log('Configuring Gruntfile for Task Runner');
      _merge(packageJSON, {
        devDependencies: {
          grunt: '^1.0.1',
          'load-grunt-config': '^0.19.2',
        },
      });
      this.log('Creating a Gruntfile');
      this.fs.copyTpl(
        this.templatePath('Gruntfile.js'),
        this.destinationPath('./Gruntfile.js'), {}
      );
      this.log('Creating an alias file for grunt');
      this.fs.copyTpl(
        this.templatePath('grunt/aliases.js'),
        this.destinationPath('./grunt/aliases.js'), {}
      );
    }
    this.log('Writing to package.json');
    this.fs.writeJSON(this.destinationPath('package.json'), packageJSON);
    this.installDependencies();
  },
});
{'fraction_non_alphanumeric': 0.15990453460620524, 'fraction_numerical': 0.004176610978520286, 'mean_word_length': 2.617044228694714, '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': '3286768', 'n_tokens_mistral': 1038, 'n_tokens_neox': 1021, 'n_words': 187}