lib/pdk/validate/tasks/tasks_name_validator.rb in pdk-2.7.1 vs lib/pdk/validate/tasks/tasks_name_validator.rb in pdk-3.0.0
- old
+ new
@@ -13,33 +13,31 @@
def pattern
contextual_pattern('tasks/**/*')
end
def spinner_text
- 'Checking task names (%{pattern}).' % {
- pattern: pattern.join(' '),
- }
+ format('Checking task names (%{pattern}).', pattern: pattern.join(' '))
end
def validate_target(report, target)
task_name = File.basename(target, File.extname(target))
if PDK::CLI::Util::OptionValidator.valid_task_name?(task_name)
report.add_event(
- file: target,
- source: name,
- state: :passed,
- severity: 'ok',
+ file: target,
+ source: name,
+ state: :passed,
+ severity: 'ok'
)
- return 0
+ 0
else
report.add_event(
- file: target,
- source: name,
- state: :failure,
+ file: target,
+ source: name,
+ state: :failure,
severity: 'error',
- message: INVALID_TASK_MSG,
+ message: INVALID_TASK_MSG
)
- return 1
+ 1
end
end
end
end
end