Chutney: Inconsistent Quoting
Chutney v3.6.0 has a new linter to detect inconsistent use of quotes in your Cucumber Gherkin.
I was reading someone's Gherkin feature files the other day and came across something like this:
Feature: My exciting feature
Scenario: My beautiful scenario
Given I have 'something'
When I do an "action"
Then a wonderful thing will happen
Nothing terrible abnormal, but just for a moment I had to think: why is something
single quoted and action
double quoted? Is there a difference? Is there something meaningful in the quoting style? There isn't, but is does look weird. So Chutney now has a linter to detect if a feature file mixes the two styles.
It also copes nicely with possessive apostrophes, both singular and plural (which was a trickier regex than I expected it to be).
Scenario: Possessions
Given the user has a thing
When the user's 'thing' is quoted
Then all users' 'things' are fine
In this example, thing
and things
are detected, the apostrophes for user
are ignored.
It will also cope with possession inside a quoted string, and embedded quotes.
Scenario: Quoted possessions
Given the user has a thing
When this 'user's thing' is quoted
Then the "'user'" is happy
In the above, user's thing
and 'user'
are detected as the quoted entity.
Member discussion