mirror of
https://gitea.invidious.io/iv-org/shard-ameba.git
synced 2024-08-15 00:53:29 +00:00
Do not report unneeded disable directive if directive is used one line above
This commit is contained in:
parent
c7fc905413
commit
1fc0c525bd
4 changed files with 28 additions and 3 deletions
|
@ -18,7 +18,16 @@ module Ameba::Rule
|
|||
subject.catch(s).should be_valid
|
||||
end
|
||||
|
||||
it "passes if there is disable directive and it is needed" do
|
||||
it "doesn't report if there is disable directive and it is needed" do
|
||||
s = Source.new %Q(
|
||||
# ameba:disable #{NamedRule.name}
|
||||
a = 1
|
||||
)
|
||||
s.error NamedRule.new, 3, 9, "Useless assignment", :disabled
|
||||
subject.catch(s).should be_valid
|
||||
end
|
||||
|
||||
it "passes if there is inline disable directive and it is needed" do
|
||||
s = Source.new %Q(
|
||||
a = 1 # ameba:disable #{NamedRule.name}
|
||||
)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue