-
-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[#505] Added Gherkin linter for Brhat tests.
- Loading branch information
1 parent
7d5f966
commit 90cc688
Showing
16 changed files
with
134 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
# Gherkin Lint | ||
|
||
https://github.com/dantleech/gherkin-lint-php | ||
|
||
> Provides a Gherkin linter for PHP. | ||
DrevOps Scaffold comes with [Gherkin Lint configuration](https://github.com/drevops/scaffold/blob/develop/gherkinlint.json) for Behat tests. | ||
|
||
## Usage | ||
|
||
```shell | ||
vendor/bin/gherkinlint lint tests/behat/features | ||
``` | ||
or | ||
```shell | ||
ahoy lint-tests | ||
``` | ||
|
||
## Configuration | ||
|
||
See [configuration reference](https://github.com/dantleech/gherkin-lint-php?tab=readme-ov-file#configuration) and [rules](https://github.com/dantleech/gherkin-lint-php/blob/master/docs/rules.md). | ||
|
||
All global configuration takes place in the [`gherkinlint.json`](https://github.com/drevops/scaffold/blob/develop/gherkinlint.json) file. | ||
The values are merged with the default configuration. | ||
|
||
To check enabled rules, run | ||
|
||
```shell | ||
vendor/bin/gherkinlint rules | ||
``` | ||
|
||
## Ignoring | ||
|
||
Ignoring rules **globally** takes place in the [`gherkinlint.json`](https://github.com/drevops/scaffold/blob/develop/gherkinlint.json) file. | ||
```json | ||
{ | ||
"rules": { | ||
"filename": { | ||
"enabled": false | ||
} | ||
} | ||
} | ||
``` | ||
|
||
Gherkin Lint does not support ignoring of all rules in the file. | ||
|
||
To ignore **a specific rule** within a file, place in the file header: | ||
```yaml | ||
# @gherkinlint-disable-rule keyword-order, someother-rule | ||
``` | ||
|
||
Gherkin Lint does not support ignoring of the **code blocks**. | ||
|
||
Gherkin Lint does not support ignoring rules on the **current line**. | ||
|
||
Gherkin Lint does not support ignoring rules on the **next line**. | ||
|
||
## Ignoring fail in CI | ||
|
||
This tool runs in CI by default and fails the build if there are any violations. | ||
|
||
Set `DREVOPS_CI_GHERKIN_LINT_IGNORE_FAILURE` environment variable to `1` to | ||
ignore failures. The tool will still run and report violations, if any. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
{ | ||
"rules": { | ||
"indentation": { | ||
"width": 2 | ||
}, | ||
"keyword-order": { | ||
"enabled": false | ||
}, | ||
"no-homogenous-tags": { | ||
"enabled": false | ||
}, | ||
"scenario-size": { | ||
"enabled": false | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
90cc688
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚀 Deployed on https://66d28006fd70528fd3428422--drevops-scaffold-docs.netlify.app