Style Rules (BS001–BS008)¶
Rules that enforce style and convention preferences.
Default severity: WARNING
BS001: tag-casing¶
Detects tags that do not follow the lowercase snake_case convention
(e.g., @smoke_test). Mixed-case or kebab-case tags are flagged.
Tags: tags, naming, convention
Since: 0.5.0
Auto-fix: Safe — converts tags to lowercase snake_case
(camelCase and kebab-case → snake_case).
Example¶
BS002: keyword-ordering¶
Detects scenarios where steps do not follow the Given-When-Then ordering convention. Steps using "And" or "But" inherit the preceding keyword's position.
Tags: steps, keywords, ordering
Since: 0.5.0
Example¶
Before → After
Before:
After:
BS003: step-phrasing¶
Detects steps that start with "I " (first-person phrasing). Third-person phrasing (e.g., "the user clicks") is preferred for readability and reusability.
Tags: steps, phrasing, readability
Since: 0.5.0
Example¶
Before → After
Before:
After:
BS004: background-name¶
Detects Background sections that lack a descriptive name. A named background improves readability and helps team members understand the common setup.
Tags: background, naming, readability
Since: 0.5.0
Example¶
Before → After
Before:
After:
BS005: feature-description-formatting¶
Detects features that lack a description. A description explains the feature's purpose and provides context for the scenarios below.
Tags: feature, description, documentation
Since: 0.5.0
Example¶
Before → After
Before:
After:
BS006: step-keyword-casing¶
Detects step keywords that are not properly capitalized. Gherkin keywords (Given, When, Then, And, But) should start with an uppercase letter.
Auto-fixable: Yes — capitalizes the first letter of step keywords.
Tags: steps, keywords, casing
Since: 1.2.0
BS007: trailing-whitespace¶
Detects lines in feature files that have trailing whitespace (spaces or tabs at the end of the line). Trailing whitespace causes unnecessary diff noise.
Auto-fixable: Yes — removes trailing whitespace from each line.
Tags: whitespace, formatting
Since: 1.2.0
BS008: tab-indentation¶
Detects lines that use tab characters for indentation. Spaces are the standard indentation for Gherkin feature files.
Auto-fixable: Yes — replaces tabs with spaces (2 per level).
Tags: indentation, tabs, formatting
Since: 1.2.0