Class: GherkinLint::InvalidFileName

Inherits:
Linter
  • Object
show all
Defined in:
lib/gherkin_lint.rb

Overview

service class to lint for invalid file names

Instance Attribute Summary

Attributes inherited from Linter

#issues

Instance Method Summary collapse

Methods inherited from Linter

#add_issue, #backgrounds, #features, #files, #filled_scenarios, #gather_tags, #initialize, #line, #lint_files, #name, #reference, #render_step, #scenarios, #steps

Constructor Details

This class inherits a constructor from GherkinLint::Linter

Instance Method Details

#lintObject



422
423
424
425
426
427
428
429
# File 'lib/gherkin_lint.rb', line 422

def lint
  files do |file|
    base = File.basename file
    next unless base != base.downcase || base =~ /[ -]/
    references = [reference(file)]
    add_issue(references, 'Feature files should be snake_cased')
  end
end