The actual logic that runs the linters
556016
def main(self, *directories):
        
        if not self.git and len(directories) == 0:
            print ("ERROR: At least one directory must be provided (or the "
                   "--git-precommit flag must be passed.\n")
            self.help()
            return

        if len(directories) > 0:
            find = local['find']
            files = []
            for directory in directories:
                real = os.path.expanduser(directory)
                if not os.path.exists(real):
                    raise ValueError("{0} does not exist".format(directory))
                files.extend(find(real, '-name', '*.py').strip().split('\n'))
            if len(files) > 0:
                print "Linting {0} python files.\n".format(len(files))
                lint(files)
            else:
                print "No python files found to lint.\n"

        else:
            status = local['git']('status', '--porcelain', '-uno')
            root = local['git']('rev-parse', '--show-toplevel').strip()

            # get all modified or added python files
            modified = re.findall(r"^[AM]\s+\S+\.py$", status, re.MULTILINE)

            # now just get the path part, which all should be relative to the
            # root
            files = [os.path.join(root, line.split(' ', 1)[-1].strip())
                     for line in modified]
            if len(files) > 0:
                lint(files)
878690
public boolean lint(String s) {
        // return true if either the specific option is enabled, or
        // they are all enabled without the specific one being
        // disabled
        return
            isSet(XLINT_CUSTOM, s) ||
            (isSet(XLINT) || isSet(XLINT_CUSTOM, "all")) &&
                isUnset(XLINT_CUSTOM, "-" + s);
    }
679618
function()
  {
    var _this = this,
        opts = _this.opts,
        code = _this.code,
        matches = _this.matches,
        classes = ['syntaxhighlighter'],
        lineNumbers,
        gutter,
        html
        ;

    if (opts.collapse === true)
      classes.push('collapsed');

    gutter = opts.gutter !== false;

    if (!gutter)
      classes.push('nogutter');

    // add custom user style name
    classes.push(opts.className);

    // add brush alias to the class name for custom CSS
    classes.push(opts.brush);

    if (gutter)
      lineNumbers = _this.figureOutLineNumbers(code);

    // processes found matches into the html
    html = _this.getMatchesHtml(code, matches);

    // finally, split all lines so that they wrap well
    html = _this.getCodeLinesHtml(html, lineNumbers);

    // finally, process the links
    if (opts.autoLinks)
      html = _this.processUrls(html);

    html = `
      <div class="${classes.join(' ')}">
        <table border="0" cellpadding="0" cellspacing="0">
          ${_this.getTitleHtml(opts.title)}
          <tbody>
            <tr>
              ${gutter ? `<td class="gutter">${_this.renderLineNumbers(code)}</td>` : ``}
              <td class="code">
                <div class="container">${html}</div>
              </td>
            </tr>
          </tbody>
        </table>
      </div>
    `;

    return html;
  }
710871
def lint(plugin)
      hooks = before_hooks(plugin) + around_hooks(plugin) + after_hooks(plugin)

      hooks.each do |hook|
        if hook.to_s.end_with?("perform")
          raise LintError, "#{plugin}.#{hook} is not namespaced"
        end
      end

      failure_hooks(plugin).each do |hook|
        if hook.to_s.end_with?("failure")
          raise LintError, "#{plugin}.#{hook} is not namespaced"
        end
      end
    end
685099
def _any_would_run(func, filenames, *args):
    """"""
    if os.environ.get("_POLYSQUARE_GENERIC_FILE_LINTER_NO_STAMPING", None):
        return True

    for filename in filenames:
        # suppress(E204)
        stamp_args, stamp_kwargs = _run_lint_on_file_stamped_args(filename,
                                                                  *args,
                                                                  **{})
        dependency = jobstamp.out_of_date(func,
                                          *stamp_args,
                                          **stamp_kwargs)

        if dependency:
            return True

    return False
1004189
function lintFileContents (messages, js) {
  // what was messages imported as
  let importedAtRootAs = false
  let importedMembersAs
  const importedMembersLookup = new Map()

  let namedMatcher, rootMatcher

  // TODO handle importing members, e.g. import { analysis } from messages

  const foundMessages = []

  let lineNumber = 0 // first increment lands at 0

  for (const line of js.split('\n')) {
    lineNumber++
    const parsedImport = parseImportLine(line)
    if (parsedImport) {
      ;[importedAtRootAs, importedMembersAs] = parsedImport
      // make sure we don't catch things like display_messages by making sure there's a diff char before
      rootMatcher = new RegExp(
        `[^a-zA-Z0-9_$]${importedAtRootAs}\\.([^ ,\\(\\)\\[}]+)`,
        'g'
      )
      namedMatcher = new RegExp(
        `[^a-zA-Z0-9_$](${importedMembersAs
          .map(a => a[1])
          .join('|')})\\.([^ ,\\(\\)\\[}]+)`,
        'g'
      )
      importedMembersAs.forEach(([member, importedAs]) =>
        importedMembersLookup.set(importedAs, member)
      )
    } else if (importedAtRootAs || importedMembersAs) {
      let result
      // each subsequent call gets next match
      if (importedAtRootAs) {
        while ((result = rootMatcher.exec(line)) != null) {
          foundMessages.push([result[1], lineNumber])
        }
      }

      // do the same for imported members
      if (importedMembersAs.length > 0) {
        while ((result = namedMatcher.exec(line)) != null) {
          // map back to the names in the messages file
          foundMessages.push([
            `${importedMembersLookup.get(result[1])}.${result[2]}`,
            lineNumber
          ])
        }
      }
    }
  }

  // filter to only the missing ones
  return foundMessages.filter(([message, lineNumber]) => {
    let current = messages
    for (const sub of message.split('.')) {
      current = current[sub]
      if (current == null) {
        return true // something in the chain is undefined
      }
    }

    return false
  })
}
926854
function Linter(ruleFilePath) {
    if (!ruleFilePath) logger.info("No rule file provided, using default rules");
    this.rules = loadRules(ruleFilePath);
    helper.initLineRulesRegexes(this.rules);
}
374841
function onStreamEnd(done) {
    Promise
      .all(lintPromiseList)
      .then(passLintResultsThroughReporters)
      .then(lintResults => {
        process.nextTick(() => {
          const errorCount = lintResults.reduce((sum, res) => {
            const errors = res.results[0].warnings.filter(isErrorSeverity);
            return sum + errors.length;
          }, 0);
          if (pluginOptions.failAfterError && errorCount > 0) {
            const errorMessage = `Failed with ${errorCount} ${errorCount === 1 ? 'error' : 'errors'}`;
            this.emit('error', new PluginError(pluginName, errorMessage));
          }
          done();
        });
      })
      .catch(error => {
        process.nextTick(() => {
          this.emit('error', new PluginError(pluginName, error, {
            showStack: Boolean(pluginOptions.debug)
          }));
          done();
        });
      });
  }
912001
def parse_linters(linters):
    
    result = list()
    for name in split_csp_str(linters):
        linter = LINTERS.get(name)
        if linter:
            result.append((name, linter))
        else:
            logging.warning("Linter `%s` not found.", name)
    return result
618292
def lint
      config.javascript_files.each do |file|
        file_content = get_file_content_as_json(file)
        code = %(
          JSHINT(#{file_content}, #{jshint_options}, #{jshint_globals});
          return JSHINT.errors;
        )
        errors[file] = context.exec(code)
      end
    end
52612
function (lintFile) {
  var deferred = new Deferred();

  parseJslintXml(lintFile, function (err, lintErrors) {
    if (lintErrors) {
      deferred.resolve(lintErrors);
    } else {
      if (err && err.code === 'ENOENT') {
        console.warn('No jslint xml file found at:', lintFile);
      } else if (err) {
        console.log(err);
      }
      deferred.reject();
    }
  });

  return deferred.promise;
}
1227194
def finished_file(file, lints)
      super

      if lints.any?
        lints.each do |lint|
          linters_with_lints[lint.linter.name] |= [lint.filename]
          linters_lint_count[lint.linter.name] += 1
        end
      end
    end
1301106
function main(env, print, cb) {
    var dir = env.opts.directory || path.resolve(env.cwd, 'artifacts/jslint'),
        lines = [],
        count = 0,
        total = 0;

    function perOffense(o) {
        var evidence = o.evidence.trim();

        count += 1;
        total += 1;

        lines.push(fmt('  #%d %d,%d: %s', count, o.line, o.col, o.msg));
        if (evidence) {
            lines.push('     ' + evidence);
        }
    }

    /**
     * invoked by lintifier.doneYet()
     * @param {object|string|null} offenses
     * @param {string} msg "Done. no lint found..."
     */
    function reporter(offenses, msg) {
        var files,
            summary,
            writeErr;

        if (('string' === typeof offenses) || offenses instanceof Error) {
            cb(offenses);
            return;
        }

        function perFile(pathname) {
            count = 0;
            lines.push(pathname);
            offenses[pathname].forEach(perOffense);
            lines.push(''); // blank line
        }

        if (offenses) {
            // accumulate report in lines array
            files = Object.keys(offenses);
            files.forEach(perFile);
            summary = getSummary(total, files.length);

            if (env.opts.print) {
                lines.unshift('JSLint Report', '');
                print(lines.join(EOL));

            } else {
                writeErr = writeHtmlFile(dir, getHtml(lines, summary));
            }

            // has errors
            cb(writeErr || summary);

        } else {
            // is lint free
            cb(null, msg);
        }
    }

    return reporter;
}
1319169
function lint(files) {
  return gulp.src(files)
    .pipe($.plumber())
    .pipe($.eslint())
    .pipe($.eslint.format())
    .pipe($.eslint.failOnError())
    .pipe($.jscs())
    .pipe($.jscs.reporter())
    .pipe($.jscs.reporter('fail'))
    .on('error', onError);
}
61514
def _init_logicals(self):
        """"""
        size = self.lines.length() + 1
        self._starts = [None] * size
        self._ends = [None] * size
        for start, end in self._generate(self.lines):
            self._starts[start] = True
            self._ends[end] = True
396690
def _lint():
    """"""
    # Flake8 doesn't have an easy way to run checks using a Python function, so
    # just fork off another process to do it.

    # Python 3 compat:
    # - The result of subprocess call outputs are byte strings, meaning we need
    #   to pass a byte string to endswith.
    project_python_files = [filename for filename in get_project_files()
                            if filename.endswith(b'.py')]
    retcode = subprocess.call(
        ['flake8', '--max-complexity=10'] + project_python_files)
    if retcode == 0:
        print_success_message('No style errors')
    return retcode
718512
function LintDirtyModulesPlugin(compiler, options) {
  this.startTime = Date.now();
  this.prevTimestamps = {};
  this.isFirstRun = true;
  this.compiler = compiler;
  this.options = options;

  // bind(this) is here to prevent context overriding by webpack
  compiler.plugin('emit', this.lint.bind(this));
}