Sha256: 81d764e7038ff4392c21e0cd9cd7bec8e9964ab080a2116d85b1557e30888370

Contents?: true

Size: 600 Bytes

Versions: 20

Compression:

Stored size: 600 Bytes

Contents

# frozen_string_literal: true

module Quality
  module Tools
    # Adds 'rubocop' tool support to quality gem
    class RailsBestPractices < Tool
      def quality_rails_best_practices
        ratchet_quality_cmd('rails_best_practices',
                            gives_error_code_on_violations: true) do |line|
          self.class.count_rails_best_practices_violations(line)
        end
      end

      # See Rubocop.included
      def self.count_rails_best_practices_violations(line)
        if line =~ /.*:[0-9]* - /
          1
        else
          0
        end
      end
    end
  end
end

Version data entries

20 entries across 20 versions & 1 rubygems

Version Path
quality-40.0.1 lib/quality/tools/rails_best_practices.rb
quality-40.0.0 lib/quality/tools/rails_best_practices.rb
quality-39.0.1 lib/quality/tools/rails_best_practices.rb
quality-38.0.1 lib/quality/tools/rails_best_practices.rb
quality-38.0.0 lib/quality/tools/rails_best_practices.rb
quality-37.1.1 lib/quality/tools/rails_best_practices.rb
quality-37.1.0 lib/quality/tools/rails_best_practices.rb
quality-37.0.1 lib/quality/tools/rails_best_practices.rb
quality-37.0.0 lib/quality/tools/rails_best_practices.rb
quality-36.1.0 lib/quality/tools/rails_best_practices.rb
quality-36.0.0 lib/quality/tools/rails_best_practices.rb
quality-35.2.1 lib/quality/tools/rails_best_practices.rb
quality-35.2.0 lib/quality/tools/rails_best_practices.rb
quality-35.1.1 lib/quality/tools/rails_best_practices.rb
quality-35.0.1 lib/quality/tools/rails_best_practices.rb
quality-35.0.0 lib/quality/tools/rails_best_practices.rb
quality-34.0.2 lib/quality/tools/rails_best_practices.rb
quality-34.0.1 lib/quality/tools/rails_best_practices.rb
quality-34.0.0 lib/quality/tools/rails_best_practices.rb
quality-33.0.0 lib/quality/tools/rails_best_practices.rb