Linter for Gherkin feature files
Project description
gherlint
Linter for Gherkin feature files, written in Python
Install
Simply run pip install gherlint.
Linting Feature Files
gherlint comes with a command line interface.
To recursively lint all feature files in a directory, run gherlint lint <path>.
Computing Metrics
gherlint can also create some metrics for you if you want to know how many features, scenarios and steps you have
in your test suite. To do so, run gherlint stats <path>.
Disclaimer
gherlint is still in an early development phase. New checks will be added over time.
If you want to contribute, feel free to open issues suggesting useful checkers, or open a pull request if you want to!
Roadmap
The following work items are planned for the upcoming releases:
- V0.0.x - V0.1.0:
- Parser and object model for feature files
- Basic checkers to demonstrate workflow
- Basic text based reporter
- V0.1.x - V1.0: <-- we are here
- Add more checkers
- Add more output formats
- Extend object model as necessary for checkers
- Reach a stable interface for object model, checkers and reporters
- Add documentation
- Support configuration to enable/disable individual messages
- V1.x - V2.0:
- Implement plugin architecture to allow users to add custom checkers
CHANGELOG
V0.5.0
New checks:
duplicated-scenario-nameduplicated-feature-nameonly-given-allowed-in-backgroundtag-could-be-on-parent
Other changes:
- Add support for configuration from a file. The file must be in
.tomlformat. You can include the configuration in yourpyproject.toml, or if you don't use that, you can create agherlint.tomlfile in the root of your project. - Individual messages can now be disabled in the configuration file (section: reporting, option: disable).
V0.4.0
New checks:
unused-parameterempty-backgroundoutline-could-be-a-scenarioconsider-using-backgroundexamples-outside-scenario-outlineduplicated-tag
Other changes:
unparseable-fileis now issued for all nodes that offend thegherkinparser together with more error information provided by itmissing-parameternow clearly states what parameter is not defined in the examples- If
gherlintpatches the file contents with a forgotten# languagetag the line numbers for messages are no longer shifted - Types of
AndandButsteps are now inferred correctly - New command
fix-language-tagsto automatically add or fix missing or incorrect language tags - Rename some message codes to have a defined structure: each checker has its own hundreds digit.
V0.3.0
New checks:
missing-language-tagwrong-language-tagunparseable-file
Other changes:
gherlintcan now automatically detect the language used and make sure that it can parse the files even without a# languagetoken present.
V0.2.0
New checks:
missing-given-stepmissing-when-stepmissing-then-stepempty-scenarioempty-featurefile-has-no-featuremissing-parameter
Other changes:
- Support for
Background - Determination of step type independent of language
- Distinction between
ScenarioandScenario Outlineindependent of language
V0.1.0
First package in alpha status:
- Parser and object model for feature files
- Basic checkers to demonstrate workflow
- Basic text based reporter
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file gherlint-0.5.0.tar.gz.
File metadata
- Download URL: gherlint-0.5.0.tar.gz
- Upload date:
- Size: 16.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
69ad21176dca442cefa57363305d7a366c6a5e7e8cfbb0eef58e4503e89b613e
|
|
| MD5 |
7e5d5c9ba6638aa7d1a9e4b2cd6dc3cb
|
|
| BLAKE2b-256 |
cb4589919c00214d2c267e1e78b2afca0a0ccf9d73e052dd25f4957dbd92a6ce
|
Provenance
The following attestation bundles were made for gherlint-0.5.0.tar.gz:
Publisher:
release.yml on DudeNr33/gherlint
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
gherlint-0.5.0.tar.gz -
Subject digest:
69ad21176dca442cefa57363305d7a366c6a5e7e8cfbb0eef58e4503e89b613e - Sigstore transparency entry: 731935578
- Sigstore integration time:
-
Permalink:
DudeNr33/gherlint@1225abbbbe5fa8a7a8f035829ad6a01bc4056547 -
Branch / Tag:
refs/tags/v0.5.0 - Owner: https://github.com/DudeNr33
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@1225abbbbe5fa8a7a8f035829ad6a01bc4056547 -
Trigger Event:
push
-
Statement type:
File details
Details for the file gherlint-0.5.0-py3-none-any.whl.
File metadata
- Download URL: gherlint-0.5.0-py3-none-any.whl
- Upload date:
- Size: 22.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
da4e54748b88381ca9caa996cb199e2a3f0c2573be3b325f78d4818135df1ac7
|
|
| MD5 |
14992036aa6a4f23418b7ef13beb04c2
|
|
| BLAKE2b-256 |
7ee5ab51cd252d2c1f1419cf03fc0e5b85af11545cffde08d9f69ca27ebe7972
|
Provenance
The following attestation bundles were made for gherlint-0.5.0-py3-none-any.whl:
Publisher:
release.yml on DudeNr33/gherlint
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
gherlint-0.5.0-py3-none-any.whl -
Subject digest:
da4e54748b88381ca9caa996cb199e2a3f0c2573be3b325f78d4818135df1ac7 - Sigstore transparency entry: 731935580
- Sigstore integration time:
-
Permalink:
DudeNr33/gherlint@1225abbbbe5fa8a7a8f035829ad6a01bc4056547 -
Branch / Tag:
refs/tags/v0.5.0 - Owner: https://github.com/DudeNr33
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@1225abbbbe5fa8a7a8f035829ad6a01bc4056547 -
Trigger Event:
push
-
Statement type: