components_order_cop: make non-strict
This commit is contained in:
parent
aa5efa603e
commit
1d3ed256a0
@ -2,7 +2,7 @@ require_relative "./extend/formula_cop"
|
|||||||
|
|
||||||
module RuboCop
|
module RuboCop
|
||||||
module Cop
|
module Cop
|
||||||
module FormulaAuditStrict
|
module FormulaAudit
|
||||||
# This cop checks for correct order of components in a Formula
|
# This cop checks for correct order of components in a Formula
|
||||||
#
|
#
|
||||||
# - component_precedence_list has component hierarchy in a nested list
|
# - component_precedence_list has component hierarchy in a nested list
|
||||||
@ -62,8 +62,14 @@ module RuboCop
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# `aspell`: options and resources should be grouped by language
|
||||||
|
WHITELIST = %w[
|
||||||
|
aspell
|
||||||
|
].freeze
|
||||||
|
|
||||||
# Method to format message for reporting component precedence violations
|
# Method to format message for reporting component precedence violations
|
||||||
def component_problem(c1, c2)
|
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)})"
|
problem "`#{format_component(c1)}` (line #{line_number(c1)}) should be put before `#{format_component(c2)}` (line #{line_number(c2)})"
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
require_relative "../../rubocops/components_order_cop"
|
require_relative "../../rubocops/components_order_cop"
|
||||||
|
|
||||||
describe RuboCop::Cop::FormulaAuditStrict::ComponentsOrder do
|
describe RuboCop::Cop::FormulaAudit::ComponentsOrder do
|
||||||
subject(:cop) { described_class.new }
|
subject(:cop) { described_class.new }
|
||||||
|
|
||||||
context "When auditing formula components order" do
|
context "When auditing formula components order" do
|
||||||
|
Loading…
x
Reference in New Issue
Block a user