Sha256: 5c466e8b42c8a1a70544bfc4ada0108fa4b34aeaa6179bf2c65cfe6f09331a18

Contents?: true

Size: 527 Bytes

Versions: 15

Compression:

Stored size: 527 Bytes

Contents

# frozen_string_literal: true

module Chutney
  # service class to lint for tags used multiple times
  class TagUsedMultipleTimes < Linter
    def lint
      scenarios do |feature, scenario|
        total_tags = tags_for(feature) + tags_for(scenario)
        double_used_tags = total_tags.find_all { |a| total_tags.count(a) > 1 }.uniq!
        next if double_used_tags.nil?

        add_issue(
          I18n.t('linters.tag_used_multiple_times', tags: double_used_tags.join(',')), feature
        )
      end
    end
  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

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