mirror of
https://gitea.invidious.io/iv-org/shard-ameba.git
synced 2024-08-15 00:53:29 +00:00
Fix newly found issues
This commit is contained in:
parent
0739fad670
commit
a53d44617d
5 changed files with 6 additions and 8 deletions
|
@ -120,7 +120,7 @@ module Ameba
|
|||
it "returns list of sources" do
|
||||
config.sources.size.should be > 0
|
||||
config.sources.first.should be_a Source
|
||||
config.sources.any? { |s| s.fullpath == __FILE__ }.should be_true
|
||||
config.sources.any?(&.fullpath.==(__FILE__)).should be_true
|
||||
end
|
||||
|
||||
it "returns a list of sources mathing globs" do
|
||||
|
@ -130,7 +130,7 @@ module Ameba
|
|||
|
||||
it "returns a lisf of sources excluding 'Excluded'" do
|
||||
config.excluded = %w(**/config_spec.cr)
|
||||
config.sources.any? { |s| s.fullpath == __FILE__ }.should be_false
|
||||
config.sources.any?(&.fullpath.==(__FILE__)).should be_false
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
@ -4,9 +4,7 @@ module Ameba
|
|||
describe Severity do
|
||||
describe "#symbol" do
|
||||
it "returns the symbol for each severity in the enum" do
|
||||
Severity.values.each do |severity|
|
||||
severity.symbol.should_not be_nil
|
||||
end
|
||||
Severity.values.each(&.symbol.should_not(be_nil))
|
||||
end
|
||||
|
||||
it "returns symbol for Error" do
|
||||
|
|
|
@ -78,7 +78,7 @@ module Ameba::AST
|
|||
# scope.find_variable("foo")
|
||||
# ```
|
||||
def find_variable(name : String)
|
||||
variables.find { |v| v.name == name } || outer_scope.try &.find_variable(name)
|
||||
variables.find(&.name.==(name)) || outer_scope.try &.find_variable(name)
|
||||
end
|
||||
|
||||
# Creates a new assignment for the variable.
|
||||
|
|
|
@ -11,7 +11,7 @@ module Ameba
|
|||
rejected = rejected_globs(globs)
|
||||
selected = globs - rejected
|
||||
|
||||
expand(selected) - expand(rejected.map! { |p| p[1..-1] })
|
||||
expand(selected) - expand(rejected.map!(&.[1..-1]))
|
||||
end
|
||||
|
||||
# Expands globs. Globs can point to files or even directories.
|
||||
|
|
|
@ -126,7 +126,7 @@ module Ameba
|
|||
@sources.all? do |source|
|
||||
source.issues
|
||||
.reject(&.disabled?)
|
||||
.none? { |issue| issue.rule.severity <= @severity }
|
||||
.none?(&.rule.severity.<=(@severity))
|
||||
end
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in a new issue