Closed thiagotrentin closed 4 years ago
@enkessler what do you think in something like this? https://github.com/enkessler/cuke_linter/compare/master...thiagotrentin:add_multiple_language_support
I had thought about that before but left as 'something to do later' https://github.com/enkessler/cuke_linter/blob/dc2c2e522b5d20ae89f13d0bad18c5997a27b514/testing/cucumber/features/linters/test_with_no_action_step.feature#L30
Your approach of configuring keywords globally instead of on a per linter basis is a good idea. I'll look at it more over the weekend.
My two main thoughts are
If we're going to be dynamic about it and get the relevant keywords from Gherkin itself, I'd rather do it indirectly via CukeModeler because that gem is meant to be an abstraction layer so that other gems (like this one) don't have to worry about API changes in gherkin
, which we would be susceptible to if we were to get the dialects directly from it. And, yes, how gherkin
exposes its dialects, if it does at all, has changed from version to version.
While inline configuration using Ruby code is an option, I definitely want language/keyword configuration to also be able to be done via the configuration files. Yes, this gem require Ruby to run the executable but it is otherwise language independent and can be used on any feature files, even if the flavor of Cucumber used to run them (e.g. Java, Pythin, C#) differs from user to user. So I want users to be able to use any configurable option via the config files so that they don't need to know Ruby to get use out of the gem.
- If we're going to be dynamic about it and get the relevant keywords from Gherkin itself, I'd rather do it indirectly via CukeModeler because that gem is meant to be an abstraction layer so that other gems (like this one) don't have to worry about API changes in
gherkin
, which we would be susceptible to if we were to get the dialects directly from it. And, yes, howgherkin
exposes its dialects, if it does at all, has changed from version to version.
make sense, what do you suggest in this case?
2. While inline configuration using Ruby code is an option, I definitely want language/keyword configuration to also be able to be done via the configuration files. Yes, this gem require Ruby to run the executable but it is otherwise language independent and can be used on any feature files, even if the flavor of Cucumber used to run them (e.g. Java, Pythin, C#) differs from user to user. So I want users to be able to use any configurable option via the config files so that they don't need to know Ruby to get use out of the gem.
@enkessler what do you think about a global language/dialect configuration for all linters?
would you considering something like this?
AllLinters:
GherkinLanguage: 'pt'
@enkessler what do you think about this approach: https://github.com/enkessler/cuke_linter/compare/master...thiagotrentin:gherkin_dialect_config
would you considering something like this?
AllLinters: GherkinLanguage: 'pt'
That's the idea. Alternatively, if we wanted to kick the can down the road regarding how to get at the Gherkin
dialects, we could just have the keywords be directly configurable. Something like
AllLinters:
Given:
- Foo
- Bar
When:
- Baz
Then:
- Then
That's the idea. Alternatively, if we wanted to kick the can down the road regarding how to get at the
Gherkin
dialects, we could just have the keywords be directly configurable. Something likeAllLinters: Given: - Foo - Bar When: - Baz Then: - Then
Great, I'll open a PR with it, thanks!
@thiagotrentin 0.13.0
is now out, which should solve this issue.
Closing this in a few days, unless I hear otherwise.
Subject of the issue The cuke_linter only works in English language to validate the Cucumber keywords (Given, When, Then).
This make it hard to use linter for Gherkin scenarios written in other language, in my case pt-BR.
Your environment cuke_linter (0.12.0) cuke_modeler (2.0.0)
Steps to reproduce Execute cuke_linter against the following feature_file
Expected behavior No issues detected.
Actual behavior
I'd be glad helping to improve this feature