tasks/pylint.js
function (options) {
    var pylintArgs = [];

    var enable = options.enable;
    delete options.enable;

    if (enable) {
      pylintArgs.push('--enable=' + enable);
    }

    var disable = options.disable;
    delete options.disable;

    if (disable) {
      pylintArgs.push('--disable=' + disable);
    }

    var messageTemplate = options.messageTemplate;
    delete options.messageTemplate;

    if (messageTemplate) {
      var aliases = {
        'short': "line {line}: {msg} ({symbol})",
        'msvs': "{path}({line}): [{msg_id}({symbol}){obj}] {msg}",
        'parseable': "{path}:{line}: [{msg_id}({symbol}), {obj}] {msg}",
      };
      if (aliases[messageTemplate] !== undefined) {
        pylintArgs.push('--msg-template="' + aliases[messageTemplate] + '"');
      } else {
        pylintArgs.push('--msg-template="' + messageTemplate + '"');
      }
    }

    var outputFormat = options.outputFormat;
    delete options.outputFormat;

    if (outputFormat) {
      pylintArgs.push('--output-format=' + outputFormat);
    }

    var report = options.report;
    delete options.report;

    // Make compatible with --reports as well
    if (options.reports) {
      report = options.reports;
      delete options.reports;
    }

    if (report) {
      pylintArgs.push('--reports=y');
    } else {
      pylintArgs.push('--reports=n');
    }

    var rcfile = options.rcfile;
    delete options.rcfile;

    if (rcfile) {
      pylintArgs.push('--rcfile=' + rcfile);
    }

    var score = options.score;
    delete options.score;

    if (score) {
      pylintArgs.push('--score=y');
    } else {
      pylintArgs.push('--score=n');
    }

    var errorsOnly = options.errorsOnly;
    delete options.errorsOnly;

    if (errorsOnly) {
      pylintArgs.push('--errors-only');
    }

    var ignore = options.ignore;
    delete options.ignore;

    if (ignore) {
      pylintArgs.push('--ignore=' + ignore);
    }

    // Fail if there's any options remaining now
    for (var prop in options) {
      if (options.hasOwnProperty(prop)) {
        grunt.fail.warn("Unknown option to pylint: '" + prop + "'");
      }
    }

    return pylintArgs;
  }
function (options) {
    var pylintArgs = [];

    var enable = options.enable;
    delete options.enable;

    if (enable) {
      pylintArgs.push('--enable=' + enable);
    }

    var disable = options.disable;
    delete options.disable;

    if (disable) {
      pylintArgs.push('--disable=' + disable);
    }

    var messageTemplate = options.messageTemplate;
    delete options.messageTemplate;

    if (messageTemplate) {
      var aliases = {
        'short': "line {line}: {msg} ({symbol})",
        'msvs': "{path}({line}): [{msg_id}({symbol}){obj}] {msg}",
        'parseable': "{path}:{line}: [{msg_id}({symbol}), {obj}] {msg}",
      };
      if (aliases[messageTemplate] !== undefined) {
        pylintArgs.push('--msg-template="' + aliases[messageTemplate] + '"');
      } else {
        pylintArgs.push('--msg-template="' + messageTemplate + '"');
      }
    }

    var outputFormat = options.outputFormat;
    delete options.outputFormat;

    if (outputFormat) {
      pylintArgs.push('--output-format=' + outputFormat);
    }

    var report = options.report;
    delete options.report;

    // Make compatible with --reports as well
    if (options.reports) {
      report = options.reports;
      delete options.reports;
    }

    if (report) {
      pylintArgs.push('--reports=y');
    } else {
      pylintArgs.push('--reports=n');
    }

    var rcfile = options.rcfile;
    delete options.rcfile;

    if (rcfile) {
      pylintArgs.push('--rcfile=' + rcfile);
    }

    var score = options.score;
    delete options.score;

    if (score) {
      pylintArgs.push('--score=y');
    } else {
      pylintArgs.push('--score=n');
    }

    var errorsOnly = options.errorsOnly;
    delete options.errorsOnly;

    if (errorsOnly) {
      pylintArgs.push('--errors-only');
    }

    var ignore = options.ignore;
    delete options.ignore;

    if (ignore) {
      pylintArgs.push('--ignore=' + ignore);
    }

    // Fail if there's any options remaining now
    for (var prop in options) {
      if (options.hasOwnProperty(prop)) {
        grunt.fail.warn("Unknown option to pylint: '" + prop + "'");
      }
    }

    return pylintArgs;
  }
function ( options ) { var pylintArgs = [ ] ; var enable = options . enable ; delete options . enable ; if ( enable ) { pylintArgs . push ( '--enable=' + enable ) ; } var disable = options . disable ; delete options . disable ; if ( disable ) { pylintArgs . push ( '--disable=' + disable ) ; } var messageTemplate = options . messageTemplate ; delete options . messageTemplate ; if ( messageTemplate ) { var aliases = { 'short' : "line {line}: {msg} ({symbol})" , 'msvs' : "{path}({line}): [{msg_id}({symbol}){obj}] {msg}" , 'parseable' : "{path}:{line}: [{msg_id}({symbol}), {obj}] {msg}" , } ; if ( aliases [ messageTemplate ] !== undefined ) { pylintArgs . push ( '--msg-template="' + aliases [ messageTemplate ] + '"' ) ; } else { pylintArgs . push ( '--msg-template="' + messageTemplate + '"' ) ; } } var outputFormat = options . outputFormat ; delete options . outputFormat ; if ( outputFormat ) { pylintArgs . push ( '--output-format=' + outputFormat ) ; } var report = options . report ; delete options . report ; // Make compatible with --reports as well if ( options . reports ) { report = options . reports ; delete options . reports ; } if ( report ) { pylintArgs . push ( '--reports=y' ) ; } else { pylintArgs . push ( '--reports=n' ) ; } var rcfile = options . rcfile ; delete options . rcfile ; if ( rcfile ) { pylintArgs . push ( '--rcfile=' + rcfile ) ; } var score = options . score ; delete options . score ; if ( score ) { pylintArgs . push ( '--score=y' ) ; } else { pylintArgs . push ( '--score=n' ) ; } var errorsOnly = options . errorsOnly ; delete options . errorsOnly ; if ( errorsOnly ) { pylintArgs . push ( '--errors-only' ) ; } var ignore = options . ignore ; delete options . ignore ; if ( ignore ) { pylintArgs . push ( '--ignore=' + ignore ) ; } // Fail if there's any options remaining now for ( var prop in options ) { if ( options . hasOwnProperty ( prop ) ) { grunt . fail . warn ( "Unknown option to pylint: '" + prop + "'" ) ; } } return pylintArgs ; }
Build the argument list sent to pylint from the options object
Build the argument list sent to pylint from the options object