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
- Docker Compose
ahoy lint-tests
docker compose exec cli vendor/bin/gherkinlint lint tests/behat/features
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.
Ignoring fail in continuous integration pipeline
This tool runs in the continuous integration pipeline by default and fails the build if there are any violations.
Set the VORTEX_CI_GHERKIN_LINT_IGNORE_FAILURE environment variable to 1 to
ignore failures. The tool will still run and report violations, if any.