def generate_config_for_linter(linter, files)
      [].tap do |output|
        output << "  # Offense count: #{linters_lint_count[linter]}"
        output << "  #{linter}:"
        # disable the linter when there are many files with offenses.
        # exclude the affected files otherwise.
        if files.count > exclude_limit
          output << '    enabled: false'
        else
          output << '    exclude:'
          files.each do |filename|
            output << %{      - "#{filename}"}
          end
        end
      end.join("\n")
    end
def generate_config_for_linter(linter, files)
      [].tap do |output|
        output << "  # Offense count: #{linters_lint_count[linter]}"
        output << "  #{linter}:"
        # disable the linter when there are many files with offenses.
        # exclude the affected files otherwise.
        if files.count > exclude_limit
          output << '    enabled: false'
        else
          output << '    exclude:'
          files.each do |filename|
            output << %{      - "#{filename}"}
          end
        end
      end.join("\n")
    end
Constructs the configuration for excluding a linter in some files.

 @param linter [String] the name of the linter to exclude
 @param files [Array<String>] the files in which the linter is excluded
 @return [String] a Yaml-formatted configuration