Scans the files specified by the given options for lints.

 @return [Integer] exit status code
8022
def scan_for_lints(options)
      reporter = reporter_from_options(options)
      report = Runner.new.run(options.merge(reporter: reporter))
      report.display
      report.failed? ? Sysexits::EX_DATAERR : Sysexits::EX_OK
    end
65728
def extract_required_files(files, options = {})
      return [] if files.nil? || files.empty?
      seen = []
      files.inject([]) do |extracted, req_js|
        include_files, include_options = if req_js.last.is_a?(Hash)
          [req_js[0..-2], options.merge(req_js.last)]
        else
          [req_js, options]
        end
        seen += (includes = include_files - seen)
        extracted << (includes + [include_options]) unless includes.empty?
        extracted
      end
    end
269135
function lintFiles(files) {

    const eslint = new CLIEngine()

    const report = eslint.executeOnFiles(files)

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

}
770787
def lint_files(files = nil)
      # Installs a prose checker if needed
      system "pip install --user proselint" unless proselint_installed?

      # Check that this is in the user's PATH
      if `which proselint`.strip.empty?
        fail "proselint is not in the user's PATH, or it failed to install"
      end

      # Either use files provided, or use the modified + added
      markdown_files = files ? Dir.glob(files) : (modified_files + added_files)
      markdown_files.select! { |line| line.end_with?(".markdown", ".md") }

      # TODO: create the disabled linters JSON in ~/.proselintrc
      # using @disable_linter

      # Convert paths to proselint results
      require 'json'
      result_jsons = Hash[markdown_files.uniq.collect { |v| [v, JSON.parse(`proselint #{v} --json`.strip)] }]
      proses = result_jsons.select { |path, prose| prose['data']['errors'].count }

      # Get some metadata about the local setup
      current_branch = env.request_source.pr_json["head"]["ref"]
      current_slug = env.ci_source.repo_slug

      # We got some error reports back from proselint
      if proses.count > 0
        message = "### Proselint found issues\n\n"
        proses.each do |path, prose|
          github_loc = "/#{current_slug}/tree/#{current_branch}/#{path}"
          message << "#### [#{path}](#{github_loc})\n\n"

          message << "Line | Message | Severity |\n"
          message << "| --- | ----- | ----- |\n"

          prose["data"]["errors"].each do |error|
            message << "#{error['line']} | #{error['message']} | #{error['severity']}\n"
          end
        end

        markdown message
      end
    end
1178001
def config_file_contents
      output = []
      output << HEADING
      output << 'linters:' if linters_with_lints.any?
      linters_with_lints.each do |linter, files|
        output << generate_config_for_linter(linter, files)
      end
      output.join("\n\n")
    end
387573
def parse(args)
      @options = { :report => false }

      OptionParser.new do |parser|
        parser.banner = "Usage: todo_lint [options] [files]"
        add_config_options parser
        exclude_file_options parser
        include_extension_options parser
        report_version parser
        report_report_options parser
      end.parse!(args)

      # Any remaining arguments are assumed to be files
      options[:files] = args

      options
    end
1360828
def lint_results
      bin = eslint_path
      raise 'eslint is not installed' unless bin
      return run_lint(bin, '.') unless filtering
      ((git.modified_files - git.deleted_files) + git.added_files)
        .select { |f| f.end_with? '.js' }
        .map { |f| f.gsub("#{Dir.pwd}/", '') }
        .map { |f| run_lint(bin, f).first }
    end
685653
def nlst(dir = nil)
      cmd = "NLST"
      if dir
        cmd = cmd + " " + dir
      end
      files = []
      retrlines(cmd) do |line|
        files.push(line)
      end
      return files
    end
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
176068
def evals_or_file
      # --library
      return if lib_only

      if evals.any?
        yield evals.join("\n"), '-e'
      elsif file && (filename != '-' || evals.empty?)
        yield file.read, filename
      end
    end
406769
def check(method = :warn)
      raise 'Unsupported method' unless %i[message warn fail].include?(method)
      @nslogs = []
      @prints = []

      check_files files_of_interest

      print_logs method
    end
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
585871
def files
    @files ||= lambda {
      sorted_relevant_files = []

      file_globs.each do |glob|
        current_glob_files  = Pathname.glob(glob)
        relevant_glob_files = relevant_files & current_glob_files

        relevant_glob_files.map! do |file|
          File.new(path:            file,
                   namespaces:      namespaces,
                   decryption_keys: decryption_keys,
                   encryption_keys: encryption_keys)
        end

        sorted_relevant_files += relevant_glob_files
      end

      sorted_relevant_files.uniq
    }.call
  end
1036441
def lint(commit = nil)
      files = pronto(commit)
      return if files.empty?

      markdown offenses_message(files)
    end
551510
def lint(args):
    """"""
    application = get_current_application()
    if not args:
        args = [application.name, 'tests']
    args = ['flake8'] + list(args)
    run.main(args, standalone_mode=False)
584041
def checkout_files(files)
      files = Array(files).select { |path| files_paths.include? path }
      checkout nil, files: files if files
    end
1198300
def run_linter_on_file?(config, linter, file)
      linter_config = config.for_linter(linter)

      if linter_config['include'].any? &&
         !HamlLint::Utils.any_glob_matches?(linter_config['include'], file)
        return false
      end

      if HamlLint::Utils.any_glob_matches?(linter_config['exclude'], file)
        return false
      end

      true
    end