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.42.1 lib/scss_lint/reporter/config_reporter.rb
scss_lint-0.42.0 lib/scss_lint/reporter/config_reporter.rb
scss_lint-0.41.0 lib/scss_lint/reporter/config_reporter.rb
scss_lint-0.40.1 lib/scss_lint/reporter/config_reporter.rb
scss_lint-0.40.0 lib/scss_lint/reporter/config_reporter.rb
scss_lint-0.39.0 lib/scss_lint/reporter/config_reporter.rb
scss_lint-0.38.0 lib/scss_lint/reporter/config_reporter.rb
scss-lint-0.38.0 lib/scss_lint/reporter/config_reporter.rb
scss-lint-bliss-1.0.0 lib/scss_lint/reporter/config_reporter.rb
scss-lint-0.37.0 lib/scss_lint/reporter/config_reporter.rb
scss-lint-0.36.1 lib/scss_lint/reporter/config_reporter.rb
scss-lint-0.36.0 lib/scss_lint/reporter/config_reporter.rb
scss-lint-0.35.0 lib/scss_lint/reporter/config_reporter.rb
scss-lint-0.34.0 lib/scss_lint/reporter/config_reporter.rb
scss-lint-0.33.0 lib/scss_lint/reporter/config_reporter.rb
scss-lint-0.32.0 lib/scss_lint/reporter/config_reporter.rb
scss-lint-0.31.0 lib/scss_lint/reporter/config_reporter.rb
scss-lint-0.30.0 lib/scss_lint/reporter/config_reporter.rb
scss-lint-0.29.0 lib/scss_lint/reporter/config_reporter.rb
scss-lint-0.28.0 lib/scss_lint/reporter/config_reporter.rb