mirror of
https://gitea.invidious.io/iv-org/shard-ameba.git
synced 2024-08-15 00:53:29 +00:00
parent
4000ac7d4d
commit
af395a3c13
2 changed files with 18 additions and 1 deletions
|
@ -150,6 +150,21 @@ module Ameba
|
|||
Runner.new(rules, [s], formatter, Severity::Warning).run.success?.should be_true
|
||||
Runner.new(rules, [s], formatter, Severity::Refactoring).run.success?.should be_false
|
||||
end
|
||||
|
||||
it "returns false if issue is disabled" do
|
||||
rules = [NamedRule.new] of Rule::Base
|
||||
source = Source.new %(
|
||||
def foo
|
||||
bar = 1 # ameba:disable #{NamedRule.name}
|
||||
end
|
||||
)
|
||||
source.add_issue NamedRule.new, location: {2, 1},
|
||||
message: "Useless assignment"
|
||||
|
||||
Runner
|
||||
.new(rules, [source], formatter, default_severity)
|
||||
.run.success?.should be_true
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -112,7 +112,9 @@ module Ameba
|
|||
#
|
||||
def success?
|
||||
@sources.all? do |source|
|
||||
source.issues.none? { |issue| issue.rule.severity <= @severity }
|
||||
source.issues
|
||||
.reject(&.disabled?)
|
||||
.none? { |issue| issue.rule.severity <= @severity }
|
||||
end
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in a new issue