Class: RuboCop::Cop::Rake::Desc
- Inherits:
-
Base
- Object
- Base
- RuboCop::Cop::Rake::Desc
- Extended by:
- AutoCorrector
- Includes:
- Helper::OnTask
- Defined in:
- lib/rubocop/cop/rake/desc.rb
Overview
Rake task definition should have a description with desc method.
It is useful as a documentation of task. And Rake does not display
task that does not have desc by rake -T.
Note: This cop does not require description for the default task,
because the default task is executed with rake without command.
Constant Summary collapse
- MSG =
'Describe the task with `desc` method.'
Constants included from Helper::OnTask
Helper::OnTask::RESTRICT_ON_SEND
Instance Method Summary collapse
Methods included from Helper::OnTask
Instance Method Details
#on_task(node) ⇒ Object
40 41 42 43 44 45 46 47 48 |
# File 'lib/rubocop/cop/rake/desc.rb', line 40 def on_task(node) return if task_with_desc?(node) return if Helper::TaskName.task_name(node) == :default requirements = prerequisites(node) return if requirements&.array_type? add_offense(node) end |