ducminh-phan / reformat-gherkin

Formatter for Gherkin language
MIT License
24 stars 13 forks source link

Align step keywords to the longest keyword in the current scenario #28

Closed rayjolt closed 4 years ago

rayjolt commented 4 years ago

When --alignment left or --alignment right is specified, align step keywords to the longest keyword in the current scenario, instead of the longest keyword of all keywords for the current Gherkin dialect. This fixes step keyword alignment for English scenarios with no "Given" step, and also fixes a problem where the Gherkin dialect was always treated as English for the purpose of finding step keyword length.

Fixes: #27

rayjolt commented 4 years ago

Closing due to discussion in #27: all step texts in the document should be aligned vertically, but with this code steps for different scenarios can have different alignment.