Class: LinterChanges::CLI
- Inherits:
-
Thor
- Object
- Thor
- LinterChanges::CLI
- Extended by:
- T::Sig
- Defined in:
- lib/linter_changes/cli.rb
Constant Summary collapse
- AVAILABLE_LINTERS =
{ 'rubocop' => LinterChanges::Linter::RuboCop::Adapter, 'eslint' => LinterChanges::Linter::Eslint::Adapter }.freeze
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.exit_on_failure? ⇒ Boolean
44 45 46 |
# File 'lib/linter_changes/cli.rb', line 44 def self.exit_on_failure? true end |
Instance Method Details
#lint ⇒ Object
28 29 30 31 32 33 34 35 36 37 38 39 40 41 |
# File 'lib/linter_changes/cli.rb', line 28 def lint Logger.debug_mode = [:debug] Logger.debug "Using configuration file: #{[:config_file]}" @config = LinterChanges::Config.load(config_file: [:config_file]) overall_success = T.let(true, T::Boolean) select_linters.each do |linter| Logger.debug "Running #{linter.name.capitalize} linter" overall_success &&= linter.run end exit(overall_success ? 0 : 1) end |