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.25.5 lib/standard/detects_fixability.rb
standard-1.25.4 lib/standard/detects_fixability.rb
standard-1.25.3 lib/standard/detects_fixability.rb
standard-1.25.2 lib/standard/detects_fixability.rb
standard-1.25.1 lib/standard/detects_fixability.rb
standard-1.25.0 lib/standard/detects_fixability.rb
standard-1.24.3 lib/standard/detects_fixability.rb
standard-1.24.2 lib/standard/detects_fixability.rb
standard-1.24.1 lib/standard/detects_fixability.rb
standard-1.24.0 lib/standard/detects_fixability.rb
standard-1.23.0 lib/standard/detects_fixability.rb
standard-1.22.1 lib/standard/detects_fixability.rb
standard-1.22.0 lib/standard/detects_fixability.rb
standard-1.21.1 lib/standard/detects_fixability.rb
standard-1.21.0 lib/standard/detects_fixability.rb
standard-1.20.0 lib/standard/detects_fixability.rb
standard-1.19.1 lib/standard/detects_fixability.rb
standard-1.19.0 lib/standard/detects_fixability.rb
standard-1.18.1 lib/standard/detects_fixability.rb
standard-1.18.0 lib/standard/detects_fixability.rb