Open kiranparajuli589 opened 2 years ago
The linter would have to be made aware of the step-implementation location and language. For frameworks that are also written in JS, it should be easy enough for the linter to see if it can find a matching step. For other languages (for example, Behat implemented in PHP), the linter will have to search the PHP code for tags like @Given
@When
@Then
in comments.
Maybe the text after the tags will have similar formats in every (most) implementations - a regex to match, or some plain text with a few simple ways to mention variables and alternative words.
So the linter just needs to understand what a comment line looks like in each language, find the @Given
@When
@Then
tags in the comments, and make sure that there is exactly one step implementation that matches.
IMHO, the gherkin language linter should not worry about the step implementation (which will be in many different languages).
The better option to implement things like this will be editor plugins or extensions such as our gherlint-vscode
.
hmm, sounds nice. should I transfer this issue to gherlint-vscode
or close this here? @saw-jan
for every javascript test framework supporting gherkin-cucumber integration, the step definition part is lagvag same.
like the dry run in nightwatch v2, we can detect the undefined steps using the power of gherlint.
is it a favorable rule for gherlint? 🤔