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.55.0 lib/scss_lint/reporter/config_reporter.rb
scss_lint-0.54.0 lib/scss_lint/reporter/config_reporter.rb
scss_lint-0.53.0 lib/scss_lint/reporter/config_reporter.rb
scss_lint-0.52.0 lib/scss_lint/reporter/config_reporter.rb
scss_lint-0.51.0 lib/scss_lint/reporter/config_reporter.rb
scss_lint-0.50.3 lib/scss_lint/reporter/config_reporter.rb
scss_lint-0.50.2 lib/scss_lint/reporter/config_reporter.rb
scss_lint-0.50.1 lib/scss_lint/reporter/config_reporter.rb
scss_lint-0.50.0 lib/scss_lint/reporter/config_reporter.rb
scss_lint-0.49.0 lib/scss_lint/reporter/config_reporter.rb
scss_lint-0.48.0 lib/scss_lint/reporter/config_reporter.rb
scss_lint-0.47.1 lib/scss_lint/reporter/config_reporter.rb
scss_lint-0.47.0 lib/scss_lint/reporter/config_reporter.rb
scss_lint-0.46.0 lib/scss_lint/reporter/config_reporter.rb
scss_lint-0.45.0 lib/scss_lint/reporter/config_reporter.rb
scss_lint-0.44.0 lib/scss_lint/reporter/config_reporter.rb
scss_lint-0.43.2 lib/scss_lint/reporter/config_reporter.rb
scss_lint-0.43.1 lib/scss_lint/reporter/config_reporter.rb
scss_lint-0.43.0 lib/scss_lint/reporter/config_reporter.rb
scss_lint-0.42.2 lib/scss_lint/reporter/config_reporter.rb