-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
--alignment should not force a space between the step keyword and the statement #61
Comments
Looks like a bug to me. The official Gherkin parser already has information on whether there should be a space after the step keyword (example). However, in @rayjolt Can you confirm the similar behaviour with Japanese? To be specific, this test data file should have no spaces after step keywords, correct? |
In an ideal world, there should be no spaces after the Japanese step keywords (this is how Japanese text works in real life). However, if there is no space then some tools will not recognise the words as step keywords. One such tool that I can name off the top of my head is Froglogic Squish. This means that the test data file is correct, at least for Squish. So it seems that we are in a situation in which some keywords should have a following space, and some keywords should not; and in which different tools may or may not require a space for keywords in a given language. To solve this, I would use the Gherkin parser's language data to get the default spacing for each keyword, and then make the decision of whether to add a trailing space configurable. I can think of three possible levels of configuration to consider:
To know which of these is a good idea, I think we need more data about how different tools format different language keywords. For example, maybe there is a tool that recognises |
I just tested how Squish 3.7.0 deals with |
I checked |
Hm, interesting. It seems that Squish is now parsing Japanese step names correctly. I tried Perhaps the best course of action is to use the Gherkin parser's language data to get the spacing after each keyword, and then only make the spacing configurable if we hear that this is necessary from any users. |
I added some tests for trailing space behaviour to my fork. They are failing at the moment - I will write some code to fix these and then create a pull request. @kdelvare I added the following tests for French. Does the expected output look OK to you?
At the moment, the expected output for
This is not great, as it splits up "Lorsqu'il" and "Et qu'il". However, I can't think of a better way of doing it that would keep the step keywords left-aligned and the step names aligned with each other. If you have better suggestions, please let me know. Also, feel free to correct my lousy French. ;) |
This seems perfect to me, and I see no issue with splitting up "Lorsqu'il" and "Et qu'il", when the user asks for left alignment. And your french is perfect ;) |
When formatting french gherkin files, the added space breaks the scenario (step becomes undefined).
Example:
Quand il clique sur le bouton de suppression
Et qu'il confirme la popup de validation
Et qu'il
should not be reformatted toEt qu' il
(Quand = When, Et que / Et qu' = And)Either allowing no space, or adding a new option value for --alignment would be fine.
The text was updated successfully, but these errors were encountered: