-
Notifications
You must be signed in to change notification settings - Fork 256
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
Feature/given when then snippet #596
Feature/given when then snippet #596
Conversation
I did not look deeply in the changes, but only checked gorelease report yet.
There are a lot of breaking changes in public API, if we merge this, code of many users might get broken which is bad. |
thanks for already taking a look at my draft a PR I will give it a try later. I made the change to resolve a circular dependency. Package formatters depended on models and models depended on formatters. Edit: I see I really did change the public API, confusing formatters with internal/formatters. I will change it back and investigate further what caused the circular dependency. |
I modified the PR. It should now have less breaking changes to the public API. I don't think I can do completely without it to implement this feature since there is no path to the snippet code which allowed configuration passing. Besides a global variable - which is terrible to have imho - I could not think of a way that would not change the public API. |
… via command line
Fixed the issues, but I had to remove support for v1.16. If you really want to I can add that support back in but then I have to add a deprecated function back in: strings.Title. It is the external package that string.Title advices to use that is not compatible with Go v1.16. Later I want to add expression support using Cucumbers expression implementation. They only support 1.20 and 1.21, since older versions are deprecated anyway. |
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## main #596 +/- ##
==========================================
+ Coverage 83.22% 83.83% +0.60%
==========================================
Files 28 27 -1
Lines 3416 3334 -82
==========================================
- Hits 2843 2795 -48
+ Misses 458 429 -29
+ Partials 115 110 -5 ☔ View full report in Codecov by Sentry. |
I still haven't checked all the changes (hopefully will have time tomorrow), but at glance I think we don't need an option for snippet function. I think it would be better to just switch unconditionally to new syntax. Anyway, these code snippets are just suggestions to developer, and if developer wants/needs |
🤔 What's changed?
Support multiple snippet render functions for generating code for undefined steps.
⚡️ What's your motivation?
I created this to enhance issue #545
I wanted to generate Given When Then functions instead of Step functions.
I wanted to generate steps with methods on a fixture instead of functions.
I wanted to refactor the code a bit to allow multiple snippet templates.
This all would allow to generate code that matches a teams WoW with Godog.
🏷️ What kind of change is this?
Added
Changed
♻️ Anything particular you want feedback on?
I believe the already existing code could use some refactoring and tidying. For now I moved some code around to prevent circular dependencies. Mostly due to formatters.StepDefinition (now models.StepDefinitionBase) and the keywords in formatters.
📋 Checklist: