| 1 | package App::Workflow::Lint::Rule::MissingConcurrency; | ||
| 2 | |||
| 3 | use strict; | ||
| 4 | use warnings; | ||
| 5 | use Carp qw(croak carp); | ||
| 6 | use parent 'App::Workflow::Lint::Rule'; | ||
| 7 | |||
| 8 | sub id { 'missing-concurrency' } | ||
| 9 | sub description { 'Workflow should define a concurrency group' } | ||
| 10 | sub applies_to { 'workflow' } | ||
| 11 | sub level { 'info' } | ||
| 12 | |||
| 13 | sub check_workflow { | ||
| 14 | my ($self, $wf, $ctx) = @_; | ||
| 15 | |||
| 16 | return () if exists $wf->{concurrency}; | ||
| 17 | |||
| 18 | return $self->diag( | ||
| 19 | message => "Workflow is missing a concurrency group", | ||
| 20 | path => '/', | ||
| 21 | file => $ctx->{file}, | ||
| 22 | ); | ||
| 23 | } | ||
| 24 | |||
| 25 | 1; | ||
| 26 |