Linter for Gherkin feature files with a Python module and CLI interface.
- Python 3.12 or newer
- uv
Install the project and development dependencies with uv:
uv sync --all-groupsRun the CLI from the local checkout:
uv run gherkin-lint --helpAlternatively, run the module directly:
uv run python -m gherkin_lint --helpLint one feature file:
uv run gherkin-lint features/login.featureLint multiple feature files:
uv run gherkin-lint features/login.feature features/checkout.featureLint all feature files in a directory using shell globbing:
uv run gherkin-lint features/*.featureUse a different indentation width for scenarios inside rules:
uv run gherkin-lint --indent-size 2 features/*.featureIncrease verbosity:
uv run gherkin-lint -v features/login.feature
uv run gherkin-lint -vv features/login.featureWrite output to a log file:
uv run gherkin-lint --logfile gherkin-lint.log features/*.featureThe command exits with status code 0 if no linting errors are found and with status code 1 if at least one linting error is found.
Run the pytest test suite:
uv run --group test pytestRun a single test module:
uv run --group test pytest tests/test_doc_feature_ok.pyRun tests through tox:
uvx --with tox-uv toxRun a specific tox environment:
uvx --with tox-uv tox -e py312
uvx --with tox-uv tox -e py313
uvx --with tox-uv tox -e lintRun Ruff checks:
uv run --group lint ruff check .Check formatting:
uv run --group lint ruff format --check .Apply formatting:
uv run --group lint ruff format .Build source distribution and wheel:
uv buildThe generated artifacts are written to dist/.
A typical local workflow is:
uv sync --all-groups
uv run --group lint ruff check .
uv run --group lint ruff format --check .
uv run --group test pytest
uv build