var grunt = require('grunt');
require('load-grunt-tasks')(grunt);

var files = ['test/*.js'];

grunt.initConfig({
  mochacli: {
      options: {
          reporter: 'spec',
          bail: false
      },
      all: files
  },
  jshint: {
      files: files,
      options: {
          jshintrc: '.jshintrc'
      }
  },
  jscs: {
      files: {
          src: files
      },
      options: {
          config: '.jscsrc',
          esnext: true
      }
  },
  jsbeautifier: {
      test: {
          files: {
              src: files
          },
          options: {
              mode: 'VERIFY_ONLY',
              config: '.beautifyrc'
          }
      },
      write: {
          files: {
              src: files
          },
          options: {
              config: '.beautifyrc'
          }
      }
  }
});
grunt.registerTask('test', ['jshint', 'jscs', 'jsbeautifier', 'mochacli']);

var grunt = require('grunt');
require('load-grunt-tasks')(grunt);

var files = ['test/*.js'];
var templates = ['**/*.json'];

grunt.initConfig({
  mochacli: {
      options: {
          reporter: 'spec',
          bail: false
      },
      all: files
  },
  jshint: {
      files: files,
      options: {
          jshintrc: '.jshintrc'
      }
  },
  jscs: {
      files: {
          src: files
      },
      options: {
          config: '.jscsrc',
          esnext: true
      }
  },
  jsbeautifier: {
      test: {
          files: {
              src: files
          },
          options: {
              mode: 'VERIFY_ONLY',
              config: '.beautifyrc'
          }
      },
      lint: {
          files: {
              src: templates
          },
          options: {
              mode: 'VERIFY_ONLY',
              config: '.beautifyrc'
          }
      },
      reformat: {
          files: {
              src: templates
          },
          options: {
              mode: 'VERIFY_AND_WRITE',
              config: '.beautifyrc'
          }
      },
      write: {
          files: {
              src: files
          },
          options: {
              config: '.beautifyrc'
          }
      }
  }
});
grunt.registerTask('test', ['jshint', 'jscs', 'jsbeautifier:test', 'jsbeautifier:write', 'mochacli']);

Add lint and reformat target.
Add lint and reformat target.

This is part of the ground work to have a consistent style to the template
JSON documents.  Two targets are defined.

 * Lint - verify all JSON templates follow the approved style.
 * Reformat - modify all JSON templates to follow the approved style.

The lint target will be used to gate the build in a future commit.  If a
PR does not meet the approved style it will fail the build

The reformat target is for developers. Developers should execute this
target before sending a PR to match the approved style.
