Sha256: db4135b50b1a73831450cc2839a641c70cddf3055d00d154ad928a0d9dfdb9f7

Contents?: true

Size: 604 Bytes

Versions: 48

Compression:

Stored size: 604 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)
      return unless linter
      linter.class.to_s.split('::').last
    end
  end
end

Version data entries

48 entries across 48 versions & 3 rubygems

Version Path
scss-lint-0.27.0 lib/scss_lint/reporter/config_reporter.rb
scss-lint-0.26.2 lib/scss_lint/reporter/config_reporter.rb
scss-lint-0.26.1 lib/scss_lint/reporter/config_reporter.rb
scss-lint-0.26.0 lib/scss_lint/reporter/config_reporter.rb
scss-lint-0.25.1 lib/scss_lint/reporter/config_reporter.rb
scss-lint-0.25.0 lib/scss_lint/reporter/config_reporter.rb
scss-lint-0.24.1 lib/scss_lint/reporter/config_reporter.rb
scss-lint-0.24.0 lib/scss_lint/reporter/config_reporter.rb