Class: Ea::Cli::Command::Lint
Overview
ea lint FILE [--rule=NAME] [--severity=error|warning]
Runs the Ea::Lint::Engine over a parsed model and reports offenses. Exit 1 when errors are found.
Constant Summary collapse
- COLUMNS =
%i[severity rule entity_name message].freeze
Instance Method Summary collapse
Methods inherited from Base
Constructor Details
This class inherits a constructor from Ea::Cli::Command::Base
Instance Method Details
#call ⇒ Object
13 14 15 16 17 18 19 20 |
# File 'lib/ea/cli/command/lint.rb', line 13 def call offenses = engine.run(model) offenses = filter_by_rule(offenses) offenses = filter_by_severity(offenses) rows = offenses.map { |o| [o.severity, o.rule, o.entity_name, o.] } formatter.render(rows, columns: COLUMNS) exit(1) if offenses.any?(&:error?) end |