Skip to main content

Gherkin Lint

https://github.com/dantleech/gherkin-lint-php

Provides a Gherkin linter for PHP.

Vortex comes with Gherkin Lint configuration for Behat tests.

Usage

ahoy lint-tests

Configuration

See configuration reference and rules.

All global configuration takes place in the gherkinlint.json file. The values are merged with the default configuration.

To check enabled rules, run:

ahoy cli vendor/bin/gherkinlint rules

Ignoring

Ignoring rules globally takes place in the gherkinlint.json file.

{
"rules": {
"filename": {
"enabled": false
}
}
}

To ignore a specific rule within a file, place in the file header:

# @gherkinlint-disable-rule keyword-order, someother-rule

Gherkin Lint does not support ignoring all rules within a file, ignoring code blocks, or ignoring individual lines - per-file rule suppression is the only inline mechanism.

Continuous integration

Gherkin Lint runs in the lint job of the continuous integration pipeline and fails the build on violations.

Ignoring failures

Set the VORTEX_CI_GHERKIN_LINT_IGNORE_FAILURE environment variable to 1. The tool still runs and reports violations.

➡️ See Continuous integration > Ignore tool failures