You are reading the documentation for gurkencheck 0.0.5. Go to the latest version.

gurkencheck A linter for Gherkin feature files.

no-homogenous-tags

Moves a tag up when every scenario carries it.

What it does#

When every scenario in a file has the same tag, that tag really belongs to the Feature. Writing it once at the top is shorter and stays correct when you add a new scenario. The same goes for a tag repeated on every Examples table of a Scenario Outline. You get one error per tag. A feature with only one scenario is left alone: its single scenario shares nothing with anything, and a tag that identifies that one scenario would be wrong on the Feature.

Turning it on#

Add this to your .gurkencheckrc:

{
  "no-homogenous-tags": "on"
}

Settings#

This rule has no settings. Switch it on with "no-homogenous-tags": "on".

Examples#

Passes
@smoke
Feature: Logging in

  Scenario: A known user logs in
    Given I am a known user

  Scenario: An unknown user is turned away
    Given I am not a known user
Fails
Feature: Logging in

  @smoke
  Scenario: A known user logs in
    Given I am a known user

  @smoke
  Scenario: An unknown user is turned away
    Given I am not a known user

gurkencheck reports: Every Scenario on this Feature has the tag @smoke, it should be defined on the Feature instead