Class: Codeowners::Cli::Main

Inherits:
Base
  • Object
show all
Defined in:
lib/codeowners/cli/main.rb

Overview

Command Line Interface used by bin/codeowners-checker.

Instance Method Summary collapse

Methods inherited from Base

#initialize

Constructor Details

This class inherits a constructor from Codeowners::Cli::Base

Instance Method Details

#check(repo = '.') ⇒ Object

for pre-commit: –from HEAD –to index



25
26
27
28
29
30
31
32
33
34
35
# File 'lib/codeowners/cli/main.rb', line 25

def check(repo = '.')
  checker = create_checker(repo)
  if checker.consistent?
    Reporter.print '✅ File is consistent'
    exit 0
  end

  options[:interactive] ? interactive_mode(checker) : report_inconsistencies(checker)

  exit(-1)
end