/**
 * grunt-npm-validate
 * https://github.com/joshuaspence/grunt-npm-validate
 *
 * Copyright (c) 2014 Joshua Spence
 * Licensed under the MIT license.
 */
module.exports = function(grunt) {
    'use strict';

    var chalk = require('chalk'),
        PJV = require('package-json-validator').PJV;

    grunt.registerTask('npm-validate', 'Opinionated package.json validator.', function() {
        var options = this.options({
            file: grunt.config('pkgFile') || 'package.json',
            force: false,
            strict: false
        });

        grunt.log.write('Validating ' + options.file + '...');

        var result = PJV.validate(grunt.file.read(options.file));
        var fail = result.errors || options.strict && result.warnings;

        if (fail) {
            grunt.log.error();
        } else {
            grunt.log.ok();
        }

        if (result.errors && result.errors.length) {
            grunt.log.subhead(chalk.bold(chalk.red('Errors:')));
            result.errors.forEach(function(error) {
                grunt.log.error(error);
            });
        }

        if (result.warnings && result.warnings.length) {
            grunt.log.subhead(chalk.bold(chalk.yellow('Warnings:')));
            result.warnings.forEach(function(warning) {
                grunt.log.warn(warning);
            });
        }

        if (result.recommendations && result.recommendations.length) {
            grunt.log.subhead(chalk.bold(chalk.green('Recommendations:')));
            result.recommendations.forEach(function(recommendation) {
                grunt.log.warn(recommendation);
            });
        }

        return options.force || !fail;
    });
};

@@ -629,16 +629,17 @@
 r result
+s
  = PJV.v
@@ -699,24 +699,25 @@
 ail = result
+s
 .errors %7C%7C o
@@ -731,32 +731,33 @@
 strict && result
+s
 .warnings;%0A%0A    
@@ -873,24 +873,25 @@
   if (result
+s
 .errors && r
@@ -891,24 +891,25 @@
 rs && result
+s
 .errors.leng
@@ -997,16 +997,17 @@
   result
+s
 .errors.
@@ -1113,24 +1113,25 @@
   if (result
+s
 .warnings &&
@@ -1133,24 +1133,25 @@
 gs && result
+s
 .warnings.le
@@ -1246,16 +1246,17 @@
   result
+s
 .warning
@@ -1367,24 +1367,25 @@
   if (result
+s
 .recommendat
@@ -1394,24 +1394,25 @@
 ns && result
+s
 .recommendat
@@ -1494,32 +1494,32 @@
 endations:')));%0A
-
             resu
@@ -1520,16 +1520,17 @@
   result
+s
 .recomme

Rename a variable.