Sha256: 074fb242450400c1a76e5fd058242ea80f2615c328f6634eef87b767550afeab

Contents?: true

Size: 455 Bytes

Versions: 5

Compression:

Stored size: 455 Bytes

Contents

require 'chutney/linter'

module Chutney
  # service class to lint for missing feature names
  class MissingFeatureName < Linter
    MESSAGE = 'All features should have a name'.freeze
    
    def lint
      features do |file, feature|
        name = feature.key?(:name) ? feature[:name].strip : ''
        next unless name.empty?
        
        references = [reference(file, feature)]
        add_error(references, MESSAGE)
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
chutney-1.6.3 lib/chutney/linter/missing_feature_name.rb
chutney-1.6.2 lib/chutney/linter/missing_feature_name.rb
chutney-1.6.1 lib/chutney/linter/missing_feature_name.rb
chutney-1.6.0 lib/chutney/linter/missing_feature_name.rb
chutney-0.5.0 lib/chutney/linter/missing_feature_name.rb