Module: Rubocop::Stylecheck::Cli
- Defined in:
- lib/rubocop/stylecheck/cli.rb
Class Method Summary collapse
- .options ⇒ Object
- .options_with_auto_correct ⇒ Object
- .options_with_cop ⇒ Object
- .run(options) ⇒ Object
Class Method Details
.options ⇒ Object
11 12 13 14 15 |
# File 'lib/rubocop/stylecheck/cli.rb', line 11 def = ["--fail-level", "refactor"] += ["--rails"] if defined?(Rails) end |
.options_with_auto_correct ⇒ Object
17 18 19 |
# File 'lib/rubocop/stylecheck/cli.rb', line 17 def + ["--auto-correct"] end |
.options_with_cop ⇒ Object
21 22 23 |
# File 'lib/rubocop/stylecheck/cli.rb', line 21 def + ["--display-cop-names"] end |
.run(options) ⇒ Object
5 6 7 8 9 |
# File 'lib/rubocop/stylecheck/cli.rb', line 5 def run() system "bundle exec rubocop #{.join(' ')}" do |ok, _res| abort "Fix code style errors" unless ok end end |