Class: Packwerk::Commands::ValidateCommand

Inherits:
BaseCommand
  • Object
show all
Extended by:
T::Sig
Defined in:
lib/packwerk/commands/validate_command.rb

Instance Method Summary collapse

Methods inherited from BaseCommand

description, #initialize

Constructor Details

This class inherits a constructor from Packwerk::Commands::BaseCommand

Instance Method Details

#runObject



12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
# File 'lib/packwerk/commands/validate_command.rb', line 12

def run
  validator_result = T.let(nil, T.nilable(Validator::Result))

  progress_formatter.started_validation do
    validator_result = validator.check_all(package_set, configuration)
  end

  validator_result = T.must(validator_result)

  if validator_result.ok?
    out.puts("Validation successful 🎉")
  else
    out.puts("Validation failed ❗\n\n#{validator_result.error_value}")
  end

  validator_result.ok?
end