<commit_before>module.exports = (grunt) ->
  # Paths
  sourceDir = 'app' # Where the source lives
  buildDir = 'public' # Where fully minified and concatenated output code lives
  configDir = 'etc' # Where to put config files
  vendorDir = 'bower_components' # Where the package-managed vendor files are

  # Load Grunt tasks
  grunt.loadNpmTasks 'grunt-contrib-clean'
  grunt.loadNpmTasks 'grunt-conventional-changelog'
  grunt.loadNpmTasks 'grunt-contrib-watch'
  grunt.loadNpmTasks 'grunt-bump'
  grunt.loadNpmTasks 'grunt-exec'
  grunt.loadNpmTasks 'grunt-karma'
  grunt.loadNpmTasks 'grunt-concurrent'

  # Configuration
  grunt.initConfig
    # Package metadata
    pkg: grunt.file.readJSON 'package.json'

    # Automatic changelog
    changelog:
      options:
        dest: 'CHANGELOG.md'
        template: 'etc/changelog.tpl'

    # Bump version to both Bower and NPM
    bump:
      options:
        files: ['package.json', 'bower.json']
        commit: false
        commitMessage: 'chore(release): v%VERSION%'
        commitFiles: ['package.json', 'client/bower.json']
        createTag: false
        tagName: 'v%VERSION%'
        tagMessage: 'Version %VERSION%'
        push: false
        pushTo: 'origin'

    # Clean house
    clean:
      build: ['public']

    # Watch
    watch:
      options:
        livereload: true
      # Run test case
      test:
        files: ["#{sourceDir}/**/*"]
        tasks: ['karma:unit:run']

    # Testing
    karma:
      options:
        configFile: "#{configDir}/karma.conf.coffee"
        browsers: ['PhantomJS']
        reporters: 'dots'
      unit:
        browsers: ['ChromeCanary']
      continuous:
        singleRun: true

    # Concurrently run watch and server
    concurrent:
      options:
        limit: 4
        logConcurrentOutput: true
      # When developing, just run the server and watch for changes
      develop: [
        # Start the Karma server
        'karma:unit:start'
        # Re-assemble on change
        'exec:brunchWatch'
        # Run tests on change
        'watch:test'
        # Run local web server
        'exec:harpServer'
      ]

    ## Execute arbitrary commands

    exec:
      # Install Bower components
      bower:
        cmd: 'node_modules/.bin/bower install'
      # Compile for development with Brunch
      brunchCompile:
        cmd: 'node_modules/.bin/brunch build'
      # Build for production with Brunch
      brunchBuild:
        cmd: 'node_modules/.bin/brunch build -P'
      # Watch for changes for re-assembly
      brunchWatch:
        cmd: 'node_modules/.bin/brunch watch'
      # Run Harp server
      harpServer:
        cmd: "node_modules/.bin/harp server #{buildDir}"
      # Kill the harp server and force exit peacefully no matter what
      harpKill:
        cmd: 'etc/kill_harp.sh'

  ## Build tasks

  # Usually you just want to run `grunt` to enter development mode
  grunt.registerTask 'default', [
    'init'
    'exec:harpKill'
    'exec:brunchCompile'
    'concurrent:develop'<commit_msg>refactor: no need to compile beforehand as `brunch watch` will do that anyway<commit_after>module.exports = (grunt) ->
  # Paths
  sourceDir = 'app' # Where the source lives
  buildDir = 'public' # Where fully minified and concatenated output code lives
  configDir = 'etc' # Where to put config files
  vendorDir = 'bower_components' # Where the package-managed vendor files are

  # Load Grunt tasks
  grunt.loadNpmTasks 'grunt-contrib-clean'
  grunt.loadNpmTasks 'grunt-conventional-changelog'
  grunt.loadNpmTasks 'grunt-contrib-watch'
  grunt.loadNpmTasks 'grunt-bump'
  grunt.loadNpmTasks 'grunt-exec'
  grunt.loadNpmTasks 'grunt-karma'
  grunt.loadNpmTasks 'grunt-concurrent'

  # Configuration
  grunt.initConfig
    # Package metadata
    pkg: grunt.file.readJSON 'package.json'

    # Automatic changelog
    changelog:
      options:
        dest: 'CHANGELOG.md'
        template: 'etc/changelog.tpl'

    # Bump version to both Bower and NPM
    bump:
      options:
        files: ['package.json', 'bower.json']
        commit: false
        commitMessage: 'chore(release): v%VERSION%'
        commitFiles: ['package.json', 'client/bower.json']
        createTag: false
        tagName: 'v%VERSION%'
        tagMessage: 'Version %VERSION%'
        push: false
        pushTo: 'origin'

    # Clean house
    clean:
      build: ['public']

    # Watch
    watch:
      options:
        livereload: true
      # Run test case
      test:
        files: ["#{sourceDir}/**/*"]
        tasks: ['karma:unit:run']

    # Testing
    karma:
      options:
        configFile: "#{configDir}/karma.conf.coffee"
        browsers: ['PhantomJS']
        reporters: 'dots'
      unit:
        browsers: ['ChromeCanary']
      continuous:
        singleRun: true

    # Concurrently run watch and server
    concurrent:
      options:
        limit: 4
        logConcurrentOutput: true
      # When developing, just run the server and watch for changes
      develop: [
        # Start the Karma server
        'karma:unit:start'
        # Re-assemble on change
        'exec:brunchWatch'
        # Run tests on change
        'watch:test'
        # Run local web server
        'exec:harpServer'
      ]

    ## Execute arbitrary commands

    exec:
      # Install Bower components
      bower:
        cmd: 'node_modules/.bin/bower install'
      # Compile for development with Brunch
      brunchCompile:
        cmd: 'node_modules/.bin/brunch build'
      # Build for production with Brunch
      brunchBuild:
        cmd: 'node_modules/.bin/brunch build -P'
      # Watch for changes for re-assembly
      brunchWatch:
        cmd: 'node_modules/.bin/brunch watch'
      # Run Harp server
      harpServer:
        cmd: "node_modules/.bin/harp server #{buildDir}"
      # Kill the harp server and force exit peacefully no matter what
      harpKill:
        cmd: 'etc/kill_harp.sh'

  ## Build tasks

  # Usually you just want to run `grunt` to enter development mode
  grunt.registerTask 'default', [
    'init'
    'exec:harpKill'
    'concurrent:develop'
{'fraction_non_alphanumeric': 0.09630238290879212, 'fraction_numerical': 0.0003286770747740345, 'mean_word_length': 2.351321585903084, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '59585', 'n_tokens_mistral': 1903, 'n_tokens_neox': 1864, 'n_words': 512}