Class: RuboCop::RakeTask
- Inherits:
-
Rake::TaskLib
- Object
- Rake::TaskLib
- RuboCop::RakeTask
- Defined in:
- lib/rubocop/rake_task.rb
Overview
Provides a custom rake task.
require ‘rubocop/rake_task’ RuboCop::RakeTask.new
Use global Rake namespace here to avoid namespace issues with custom rubocop-rake tasks
Instance Attribute Summary collapse
-
#fail_on_error ⇒ Object
Returns the value of attribute fail_on_error.
-
#formatters ⇒ Object
Returns the value of attribute formatters.
-
#name ⇒ Object
Returns the value of attribute name.
-
#options ⇒ Object
Returns the value of attribute options.
-
#patterns ⇒ Object
Returns the value of attribute patterns.
-
#requires ⇒ Object
Returns the value of attribute requires.
-
#verbose ⇒ Object
Returns the value of attribute verbose.
Instance Method Summary collapse
-
#initialize(name = :rubocop, *args, &task_block) ⇒ RakeTask
constructor
A new instance of RakeTask.
Constructor Details
#initialize(name = :rubocop, *args, &task_block) ⇒ RakeTask
Returns a new instance of RakeTask.
17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 |
# File 'lib/rubocop/rake_task.rb', line 17 def initialize(name = :rubocop, *args, &task_block) super() setup_ivars(name) desc 'Run RuboCop' unless ::Rake.application.last_description task(name, *args) do |_, task_args| RakeFileUtils.verbose(verbose) do yield(*[self, task_args].slice(0, task_block.arity)) if task_block run_cli(verbose, ) end end setup_subtasks(name, *args, &task_block) end |
Instance Attribute Details
#fail_on_error ⇒ Object
Returns the value of attribute fail_on_error.
15 16 17 |
# File 'lib/rubocop/rake_task.rb', line 15 def fail_on_error @fail_on_error end |
#formatters ⇒ Object
Returns the value of attribute formatters.
15 16 17 |
# File 'lib/rubocop/rake_task.rb', line 15 def formatters @formatters end |
#name ⇒ Object
Returns the value of attribute name.
15 16 17 |
# File 'lib/rubocop/rake_task.rb', line 15 def name @name end |
#options ⇒ Object
Returns the value of attribute options.
15 16 17 |
# File 'lib/rubocop/rake_task.rb', line 15 def @options end |
#patterns ⇒ Object
Returns the value of attribute patterns.
15 16 17 |
# File 'lib/rubocop/rake_task.rb', line 15 def patterns @patterns end |
#requires ⇒ Object
Returns the value of attribute requires.
15 16 17 |
# File 'lib/rubocop/rake_task.rb', line 15 def requires @requires end |
#verbose ⇒ Object
Returns the value of attribute verbose.
15 16 17 |
# File 'lib/rubocop/rake_task.rb', line 15 def verbose @verbose end |