Sha256: 678b6af32079ffafe7b315049483fd6285bf6a8ced86822d2be056640a97378d

Contents?: true

Size: 491 Bytes

Versions: 14

Compression:

Stored size: 491 Bytes

Contents

# frozen_string_literal: true

module Chutney
  # service class to lint for too many tags
  class TooManyTags < Linter
    def lint
      scenarios do |feature, scenario|
        tags = tags_for(feature) + tags_for(scenario)
        next unless tags.length > maxcount

        add_issue(
          I18n.t('linters.too_many_tags', count: tags.length, max: maxcount),
          feature
        )
      end
    end

    def maxcount
      configuration['MaxCount']&.to_i || 3
    end
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
chutney-3.9.0 lib/chutney/linter/too_many_tags.rb
chutney-3.8.2 lib/chutney/linter/too_many_tags.rb
chutney-3.8.1 lib/chutney/linter/too_many_tags.rb
chutney-3.8.0 lib/chutney/linter/too_many_tags.rb
chutney-3.7.0 lib/chutney/linter/too_many_tags.rb
chutney-3.6.0 lib/chutney/linter/too_many_tags.rb
chutney-3.5.0 lib/chutney/linter/too_many_tags.rb
chutney-3.3.0 lib/chutney/linter/too_many_tags.rb
chutney-3.2.1 lib/chutney/linter/too_many_tags.rb
chutney-3.2.0 lib/chutney/linter/too_many_tags.rb
chutney-3.1.1 lib/chutney/linter/too_many_tags.rb
chutney-3.1.0 lib/chutney/linter/too_many_tags.rb
chutney-3.0.1 lib/chutney/linter/too_many_tags.rb
chutney-3.0.0 lib/chutney/linter/too_many_tags.rb