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 after installing
      raise "proselint is not in the user's PATH, or it failed to install" unless proselint_installed?

      # Either use files provided, or use the modified + added
      markdown_files = get_files files

      proses = {}
      to_disable = disable_linters || ["misc.scare_quotes", "typography.symbols"]
      with_proselint_disabled(to_disable) do
        # Convert paths to proselint results
        result_jsons = Hash[markdown_files.to_a.uniq.collect { |v| [v, get_proselint_json(v)] }]
        proses = result_jsons.select { |_, prose| prose['data']['errors'].count > 0 }
      end

      # Get some metadata about the local setup
      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/#{github.branch_for_head}/#{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
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 after installing
      raise "proselint is not in the user's PATH, or it failed to install" unless proselint_installed?

      # Either use files provided, or use the modified + added
      markdown_files = get_files files

      proses = {}
      to_disable = disable_linters || ["misc.scare_quotes", "typography.symbols"]
      with_proselint_disabled(to_disable) do
        # Convert paths to proselint results
        result_jsons = Hash[markdown_files.to_a.uniq.collect { |v| [v, get_proselint_json(v)] }]
        proses = result_jsons.select { |_, prose| prose['data']['errors'].count > 0 }
      end

      # Get some metadata about the local setup
      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/#{github.branch_for_head}/#{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
Lints the globbed markdown files. Will fail if `proselint` cannot be installed correctly.
 Generates a `markdown` list of warnings for the prose in a corpus of .markdown and .md files.

 @param   [String] files
          A globbed string which should return the files that you want to lint, defaults to nil.
          if nil, modified and added files from the diff will be used.
 @return  [void]