gplint
Version:
A Gherkin linter/validator written in Javascript.
83 lines (65 loc) • 1.97 kB
Markdown
[](https://github.com/gplint/gplint/actions/workflows/test.yml)
[](https://codecov.io/gh/gplint/gplint)
[](https://www.npmjs.com/package/gplint)
Uses [Gherkin](https://github.com/cucumber/gherkin-javascript) to parse feature files and runs linting against the
default rules, and the optional rules you specified in your `.gplintrc` file.
Forked from [gherkin-lint](https://github.com/vsiakka/gherkin-lint)
Access to the documentation site to know how to use GPLint: https://gplint.github.io/
We encourage to check the site for complete documentation, but as quick start you can follow this:
Install as development dependency:
```shell
npm install --save-dev gplint
```
Set some basic rules to validate your gherkin files, to do that, create a file called `.gplintrc` with the following
content:
```json
{
"allow-all-caps": [
"error",
{
"Global": false,
"Description": false,
"ExampleHeader": true,
"ExampleBody": true
}
],
"allow-all-lowercase": [
"error",
{
"Global": false,
"Description": false,
"Step": true,
"ExampleHeader": true,
"ExampleBody": true
}
],
"file-name": [
"warn",
{
"style": "camelCase",
"allowAcronyms": true
}
],
"keywords-in-logical-order": [
"error",
{
"detectMissingKeywords": true
}
],
"no-superfluous-tags": "warn",
"no-unnamed-features": "error",
"no-unnamed-scenarios": "error",
"no-unused-variables": "warn"
}
```
Run it, checking the Gherkin files you have on `test/features` folder.
```shell
gplint tests/features
```