Add a linter for Behat .feature files
danielbachhuber opened this issue · comments
Rather than debate about it, we should enforce it with automated tests.
@danielbachhuber Were you thinking something like gherkin-lint
?
This is taken from some moodle works .gherkin-lintrc
https://github.com/rajeshtaneja/moodle/blob/master/.gherkin-lintrc
At time of writing
{
"indentation": ["on",{
"Feature": 0,
"Background": 2,
"Scenario": 2,
"Step": 4,
"given": 4,
"and": 4
}],
"no-dupe-feature-names": "on",
"no-dupe-scenario-names": "off",
"no-empty-file": "on",
"no-files-without-scenarios": "on",
"no-multiple-empty-lines": "on",
"no-partially-commented-tag-lines": "on",
"no-trailing-spaces": "on",
"no-unamed-features": "on",
"no-unamed-scenarios": "on",
"no-scenario-outlines-without-examples": "on"
}
Question: Should this be a JavaScript package, or is it worth looking for an alternative?
It is common for WordPress development to involve NodeJs, especially since the introduction of Blocks.
This is not a full WordPress.
Is NodeJS expected for a cli? Does it being CI count? Could pre-commit hooks be added?
If Just for the CI of this package / repo, it could be hidden in the various runners (travis, github, circle)
Is hiding the detail in the runners being flippant?
Does anyone lose out, from burying such detail?
Should this be either an option or forced downstream to scaffold[ed] commands?
Moodle is a monorepo, so I'm not sure how much could be learned from their runner