Sha256: 374ebee124133ce4988cccf808732fbd9b5253ef9e50b8b25827694a10064592

Contents?: true

Size: 330 Bytes

Versions: 78

Compression:

Stored size: 330 Bytes

Contents

module Standard
  class DetectsFixability
    def call(offenses)
      offenses.any? { |offense|
        cop = cop_instance(offense.cop_name)
        cop.correctable? && cop.safe_autocorrect?
      }
    end

    private

    def cop_instance(cop_name)
      RuboCop::Cop.const_get(cop_name.gsub("/", "::")).new
    end
  end
end

Version data entries

78 entries across 78 versions & 3 rubygems

Version Path
standard-1.4.0 lib/standard/detects_fixability.rb
standard-mkv-1.3.4 lib/standard/detects_fixability.rb
standard-mkv-1.3.3 lib/standard/detects_fixability.rb
standard-mkv-1.3.2 lib/standard/detects_fixability.rb
standard-mkv-1.3.1 lib/standard/detects_fixability.rb
standard-mkv-1.3.0 lib/standard/detects_fixability.rb
standard-1.3.0 lib/standard/detects_fixability.rb
standard-1.2.0 lib/standard/detects_fixability.rb
standard-1.1.7 lib/standard/detects_fixability.rb
standard-1.1.6 lib/standard/detects_fixability.rb
standard-1.1.5 lib/standard/detects_fixability.rb
standard-1.1.4 lib/standard/detects_fixability.rb
standard-1.1.3 lib/standard/detects_fixability.rb
standard-1.1.2 lib/standard/detects_fixability.rb
standard-1.1.1 lib/standard/detects_fixability.rb
standard-1.1.0 lib/standard/detects_fixability.rb
standard-1.0.5 lib/standard/detects_fixability.rb
standard-1.0.4 lib/standard/detects_fixability.rb
standard-1.0.3 lib/standard/detects_fixability.rb
standard-1.0.2 lib/standard/detects_fixability.rb