Prints lint results to the console

@param {String} filePath
@param {Object} results
962747
function printReports(filePath, results) {

  let errorCount = 0;
  let warningCount = 0;

  const table = createTable();

  Object.entries(results).forEach(function([ name, reports ]) {

    reports.forEach(function(report) {

      const {
        category,
        id,
        message,
        name: reportName
      } = report;

      table.push(tableEntry({
        category,
        id,
        message,
        name: reportName || name
      }));

      if (category === 'error') {
        errorCount++;
      } else {
        warningCount++;
      }
    });
  });

  const problemCount = warningCount + errorCount;

  if (problemCount) {
    console.log();
    console.log(underline(path.resolve(filePath)));
    console.log(table.toString());
  }

  return {
    errorCount,
    warningCount
  };
}
668820
function readFiles (filepaths, callback) {
  async.map(filepaths, readFile.bind(this), function (err, files) {

    if (err) callback(err);

    callback(null, files);
  });
}
707073
def lint():
    
    path = os.path.realpath(os.getcwd())
    cmd = 'flake8 %s' % path
    opt = ''
    print(">>> Linting codebase with the following command: %s %s" % (cmd, opt))

    try:
        return_code = call([cmd, opt], shell=True)
        if return_code < 0:
            print(">>> Terminated by signal", -return_code, file=sys.stderr)
        elif return_code != 0:
            sys.exit('>>> Lint checks failed')
        else:
            print(">>> Lint checks passed", return_code, file=sys.stderr)
    except OSError as e:
        print(">>> Execution failed:", e, file=sys.stderr)
122921
function lint (stream) {
  return stream
    .pipe(plumber({
      errorHandler: () => {}
    }))
    /** Log that we are linting the file */
    .pipe(tap((file) => {
      log.start('lint')
        .action('Linting file')
        .data(paths.fromJs(file.path))
        .send();
    }))
    /** Lint the file */
    .pipe(eslint(config))
    /** Output the results */
    .pipe(eslint.formatEach())
    .pipe(tap((file) => {
      /** There were some errors so lets not display a success message */
      if (file.eslint.messages.length > 0) {
          return;
      }

      /** We made it through the linter with no errors, good job */
      log.success('lint')
        .action('Cleanly linted')
        .data(paths.fromJs(file.path))
        .send();
    }));
}
777654
function(results, filePath) {

  var destDir = path.dirname(filePath);

  if (!grunt.file.exists(destDir)) {
    grunt.file.mkdir(destDir);
  }

  grunt.file.write(filePath, results);
  grunt.log.ok('File "' + filePath + '" created.');
}
1189603
function lint() {
  var errorsFound = false;
  var stream = gulp.src(config.lintGlobs);

  if (isWatching) {
    stream = stream.pipe(watcher());
  }

  if (argv.fix) {
    options.fix = true;
  }

  return stream.pipe(eslint(options))
    .pipe(eslint.formatEach('stylish', function(msg) {
      errorsFound = true;
      util.log(util.colors.red(msg));
    }))
    .pipe(gulpIf(isFixed, gulp.dest('.')))
    .pipe(eslint.failAfterError())
    .on('end', function() {
      if (errorsFound && !options.fix) {
        util.log(util.colors.blue('Run `gulp lint --fix` to automatically ' +
            'fix some of these lint warnings/errors. This is a destructive ' +
            'operation (operates on the file system) so please make sure ' +
            'you commit before running.'));
      }
    });
}
1319691
function(file, errorCount, warningCount) {
        if (errorCount > 0 || warningCount > 0) {
            var message = '';
            if (errorCount > 0) {
                message += colors.red(errorCount + ' lint ' + (errorCount === 1 ? 'error' : 'errors'));
            }

            if (warningCount > 0) {
                if (errorCount > 0) {
                    message += ' and ';
                }
                message += colors.yellow(warningCount + ' lint ' + (warningCount === 1 ? 'warning' : 'warnings'));
            }
            message += ' found in file ' + file.path;
            log.notice(message);
        } else {
            log.info(colors.green(file.path + ' is lint free!'));
        }
    }
62631
function readMarkdownPaths(filepath) {
  return new Promise((resolve, reject) => {
    try {
      let pathAll = [];
      const files = FS.readdirSync(filepath);
      for (let i = 0; i < files.length; i++) {
        if (/\.md$/.test(files[i])) {
          pathAll.push(path.join(filepath, files[i]));
        }
      }
      resolve(pathAll);
    } catch (err) {
      reject(err);
    }
  });
}
778701
def _run_lint_on_file_exceptions(file_path,
                                 linter_functions,
                                 tool_options,
                                 fix_what_you_can):
    
    try:
        return _run_lint_on_file(file_path,
                                 linter_functions,
                                 tool_options,
                                 fix_what_you_can)
    except Exception as exception:
        sys.stderr.write("""Encountered exception when processing {}\n""".format(file_path))
        traceback.print_exc()
        raise exception
395061
function(results, done) {
                // Find the index of the fields we want
                var rawIndex = results.fields.indexOf("_raw");
                var sourcetypeIndex = results.fields.indexOf("sourcetype");
                var userIndex = results.fields.indexOf("user");
                
                // Print out each result and the key-value pairs we want
                console.log("Results: ");
                for(var i = 0; i < results.rows.length; i++) {
                    console.log("  Result " + i + ": ");
                    console.log("    sourcetype: " + results.rows[i][sourcetypeIndex]);
                    console.log("    user: " + results.rows[i][userIndex]);
                    console.log("    _raw: " + results.rows[i][rawIndex]);
                }
                
                done();
            }
799257
def print_results(results):
    
    if not isinstance(results, list):
        results = [results]

    for r in results:
        try:
            r.log()
        except AttributeError:
            raise ValueError('Argument to print_results() must be a list of '
                             'FileValidationResults or ObjectValidationResults.')
727554
function (filePath, options)
    {
        gulpUtil.log(gulpUtil.colors.blue("jsHint"), pathHelper.makeRelative(filePath));

        var jsHintConfig = jsHintConfigHelper.getRules(xtend({
            lookup: false,
            esnext: false
        }, options));

        gulp.src(filePath)
            .pipe(plumber())
            .pipe(jshint(jsHintConfig))
            .pipe(jshint.reporter(jshintStylish));
    }
3515
function reportReducer (linter, summary, filePath) {
  const fileContents = fs.readFileSync(filePath, {encoding: 'utf8'})
  const file = linter.process(fileContents)

  if (file.messages.length !== 0) {
    this.printFilePath(filePath)

    file.messages.forEach((message) => {
      const severity = message.fatal ? 'error' : 'warning'
      this.printLintItem(message.line, message.column, severity, message.message, message.ruleId)

      if (message.fatal) {
        summary.errors += 1
      } else {
        summary.warnings += 1
      }
    })

    console.log('') // logging empty line
  }

  return summary
}
245478
def run_swiftlint(files, lint_all_files, options, additional_swiftlint_args)
      if lint_all_files
        result = swiftlint.lint(options, additional_swiftlint_args)
        if result == ''
          {}
        else
          JSON.parse(result).flatten
        end
      else
        files
          .map { |file| options.merge(path: file) }
          .map { |full_options| swiftlint.lint(full_options, additional_swiftlint_args) }
          .reject { |s| s == '' }
          .map { |s| JSON.parse(s).flatten }
          .flatten
      end
    end
269135
function lintFiles(files) {

    const eslint = new CLIEngine()

    const report = eslint.executeOnFiles(files)

    return {
        text: friendlyFormatter(report.results),
        errorCount: report.errorCount,
    }

}
905662
function log(results, stream) {
  stream = stream || process.stdout;

  if (results instanceof Error) {
    results = results.meta;
  }

  if (!_isFormatted(results)) {
    results = format(results);
  }

  stream.write(_join(results));
}
404343
function printResult(val) {
  var err = val.error ? val.error.toString() : 'no error';
  //console.log(util.inspect(val,{depth:null}));
  console.log(err);
}