no-restricted-patterns
Bans wording you do not want in your feature files.
What it does#
Some words creep into feature files and make them worse: leftover debugging steps, or vague verbs like "verify" that hide what is really being checked. List them here and they will be caught. Matching ignores upper and lower case.
Turning it on#
Add this to your .gurkencheckrc:
{
"no-restricted-patterns": ["on", {
"Global": ["^prints the last response"],
"Feature": ["verify", "validate"]
}]
}
Settings#
| Setting | Value | If you leave it out | What it does |
|---|---|---|---|
Global |
list of regular expressions | empty list |
Applied everywhere, on top of the lists below. |
Feature |
list of regular expressions | empty list |
Applied to the Feature name and description. |
Rule |
list of regular expressions | empty list |
Applied to a Rule name and description. |
Background |
list of regular expressions | empty list |
Applied to a Background description and its steps, with their data tables and doc strings. |
Scenario |
list of regular expressions | empty list |
Applied to a Scenario name, description and steps, with their data tables and doc strings. |
ScenarioOutline |
list of regular expressions | empty list |
Applied to a Scenario Outline name, description, steps with their data tables and doc strings, and the names and descriptions of its Examples. |
Examples#
Passes
Feature: Logging in
Scenario: A known user logs in
Given I am a known user
When I log in
Then I see my dashboard
Fails
Feature: Verify logging in
Scenario: A known user logs in
Given I am a known user
When I log in
Then prints the last response
gurkencheck reports: Feature name: "Verify logging in" matches restricted pattern "/verify/i"