lib/chutney/linter/too_many_steps.rb in chutney-1.6.3 vs lib/chutney/linter/too_many_steps.rb in chutney-2.0.0.rc1
- old
+ new
@@ -1,15 +1,19 @@
-require 'chutney/linter'
-
module Chutney
# service class to lint for too many steps
class TooManySteps < Linter
def lint
- filled_scenarios do |file, feature, scenario|
- next if scenario[:steps].length < 10
+ filled_scenarios do |feature, scenario|
+ next if scenario[:steps].length <= maxcount
- references = [reference(file, feature, scenario)]
- add_error(references, "Scenario is too long at #{scenario[:steps].length} steps")
+ add_issue(
+ I18n.t('linters.too_many_steps', count: scenario[:steps].length, max: maxcount),
+ feature
+ )
end
+ end
+
+ def maxcount
+ configuration['MaxCount']&.to_i || 10
end
end
end