Class: CucumberLint::TableLinter

Inherits:
Linter
  • Object
show all
Defined in:
lib/cucumber_lint/linter/table_linter.rb

Overview

A linter for a series of table rows (as parsed by Gherkin)

Instance Method Summary collapse

Methods inherited from Linter

#add_error, #add_fix

Constructor Details

#initialize(rows:, config:, linted_file:) ⇒ TableLinter

Returns a new instance of TableLinter.



9
10
11
12
13
14
# File 'lib/cucumber_lint/linter/table_linter.rb', line 9

def initialize rows:, config:, linted_file:
  super config: config, linted_file: linted_file

  @rows = rows
  @header_style = @config.consistent_table_headers.enforced_style.to_sym
end

Instance Method Details

#lintObject



17
18
19
20
# File 'lib/cucumber_lint/linter/table_linter.rb', line 17

def lint
  inconsistent_table_whitespace unless actual_table_lines == expected_table_lines
  inconsistent_table_headers if inconsistent_table_headers?
end