Always return Bool value from Rule#excluded?

This commit is contained in:
Sijawusz Pur Rahnama 2022-11-22 19:45:16 +01:00
parent 39cc286263
commit 31392046e0

View file

@ -88,7 +88,7 @@ module Ameba::Rule
# my_rule.excluded?(source) # => true or false
# ```
def excluded?(source)
excluded.try &.any? do |path|
!!excluded.try &.any? do |path|
source.matches_path?(path) ||
Dir.glob(path).any? { |glob| source.matches_path?(glob) }
end