Merge pull request #4105 from commitay/components_order

components_order_cop: make non-strict
This commit is contained in:
Mike McQuaid 2018-04-25 08:28:03 +01:00 committed by GitHub
commit 8f546918df
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 2 deletions

View File

@ -2,7 +2,7 @@ require_relative "./extend/formula_cop"
module RuboCop
module Cop
module FormulaAuditStrict
module FormulaAudit
# This cop checks for correct order of components in a Formula
#
# - component_precedence_list has component hierarchy in a nested list
@ -62,8 +62,14 @@ module RuboCop
end
end
# `aspell`: options and resources should be grouped by language
WHITELIST = %w[
aspell
].freeze
# Method to format message for reporting component precedence violations
def component_problem(c1, c2)
return if WHITELIST.include?(@formula_name)
problem "`#{format_component(c1)}` (line #{line_number(c1)}) should be put before `#{format_component(c2)}` (line #{line_number(c2)})"
end

View File

@ -1,6 +1,6 @@
require_relative "../../rubocops/components_order_cop"
describe RuboCop::Cop::FormulaAuditStrict::ComponentsOrder do
describe RuboCop::Cop::FormulaAudit::ComponentsOrder do
subject(:cop) { described_class.new }
context "When auditing formula components order" do