Class: RuboCop::Git::Runner
- Inherits:
-
Object
- Object
- RuboCop::Git::Runner
- Defined in:
- lib/rubocop/git/runner.rb
Overview
Instance Method Summary collapse
-
#initialize(exit_on_offence: true) ⇒ Runner
constructor
A new instance of Runner.
- #run(options = {}) ⇒ Object
Constructor Details
#initialize(exit_on_offence: true) ⇒ Runner
Returns a new instance of Runner.
5 6 7 |
# File 'lib/rubocop/git/runner.rb', line 5 def initialize(exit_on_offence: true) @exit_on_offence = exit_on_offence end |
Instance Method Details
#run(options = {}) ⇒ Object
9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/rubocop/git/runner.rb', line 9 def run( = {}) unless .is_a?(RuboCop::Git::Options) = RuboCop::Git::Options.new() end @options = @files = RuboCop::Git::DiffParser.parse(git_diff()) display_violations($stdout) ok = violations_with_valid_offences.none? exit(1) if @exit_on_offence && !ok ok end |