Sha256: 572e20d6083d9a250d45b7df98f5aa527876c16e1dfe327b85ccbf0393f82287

Contents?: true

Size: 577 Bytes

Versions: 6

Compression:

Stored size: 577 Bytes

Contents

module SCSSLint
  # Returns a YAML configuration where all linters are disabled which
  # caused a lint.
  class Reporter::ConfigReporter < Reporter
    def report_lints
      { 'linters' => disabled_linters }.to_yaml unless lints.empty?
    end

  private

    def disabled_linters
      linters.each_with_object({}) do |linter, m|
        m[linter] = { 'enabled' => false }
      end
    end

    def linters
      lints.map { |lint| linter_name(lint.linter) }.compact.uniq.sort
    end

    def linter_name(linter)
      linter.class.to_s.split('::').last
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
scss_lint-0.60.0 lib/scss_lint/reporter/config_reporter.rb
scss_lint-0.59.0 lib/scss_lint/reporter/config_reporter.rb
scss_lint-0.58.0 lib/scss_lint/reporter/config_reporter.rb
scss_lint-0.57.1 lib/scss_lint/reporter/config_reporter.rb
scss_lint-0.57.0 lib/scss_lint/reporter/config_reporter.rb
scss_lint-0.56.0 lib/scss_lint/reporter/config_reporter.rb