Class: CodeownersValidator::GhostPatternChecker

Inherits:
Object
  • Object
show all
Defined in:
lib/codeowners_validator/checkers/ghost_pattern_checker.rb

Defined Under Namespace

Classes: Result

Instance Method Summary collapse

Constructor Details

#initialize(entries, repo_root) ⇒ GhostPatternChecker

Returns a new instance of GhostPatternChecker.



7
8
9
10
# File 'lib/codeowners_validator/checkers/ghost_pattern_checker.rb', line 7

def initialize(entries, repo_root)
  @entries = entries
  @repo_root = repo_root
end

Instance Method Details

#runObject



12
13
14
15
# File 'lib/codeowners_validator/checkers/ghost_pattern_checker.rb', line 12

def run
  ghosts = @entries.reject { |entry| matches_something?(entry.pattern) }
  Result.new(ghosts:)
end