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.

Constant Summary collapse

LABEL =
{ missing_ref: 'Missing references', useless_pattern: 'No files matching with the pattern' }.freeze

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



20
21
22
23
24
25
26
27
# File 'lib/codeowners/cli/main.rb', line 20

def check(repo = '.')
  @codeowners_changed = false
  @repo = repo
  setup_checker
  @checker.check!
  write_codeowners if @codeowners_changed
  @checker.commit_changes! if options[:interactive] && yes?('Commit changes?')
end