-
-
Notifications
You must be signed in to change notification settings - Fork 972
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
Get name suffix from the build.yaml file #1898
Conversation
I've marked it as ready for review however, I haven't written the test/tests because I... don't know how to do it. Is it possible? |
One way to test it is to make a separate project with a build.yaml dedicated for testing purposes. There are also other ways of testing this that are more technical. If you fancy doing that, I invite you to look at how json_serializable does its tests. One thing for sure is that a unit test for decoding the options would be neat. |
It's looking pretty good though! |
Thank you for the feedback! Please give me a few days. I would like to take a look at the json_serializable tests |
@trejdych @rrousselGit Hi! Appreciate your work! What do you think about also adding a prefix option? Example config might look like this: builders:
riverpod_generator:
options:
provider_name_suffix: ""
provider_name_prefix: "providerOf" # podOf, etc... One thing to notice here is that this case will break scoping. So if an annotated function's name starts with "_" it should be moved to the beginning of the generated provider's name. I can submit an update to this PR if you don't mind or open a new one:) |
Hello @rrousselGit Sorry for the long delay. I've had some private issues 🙈 I've added a sample project and a unit test. @qoob23 another thing is the name case. Currently, the generator changes case to a lower camel case so for your options it would be |
@@ -156,6 +156,21 @@ class Home extends ConsumerWidget { | |||
} | |||
``` | |||
|
|||
## Global configuration |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't like this being in the root examples
folder.
it probably should be in the riverpod_generator folder
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
that makes more sense. I've just changed
Don't worry about source_gen_test, we don't need that part. It's mostly for error handling, which we don't have here LGTM if you can move the example to the generator folder |
Looks like the CI broke with your latest change |
I have no idea what's wrong with CI. there is a simple |
8921661
to
aa8a770
Compare
Hello, I've "fixed" the CI but there is a coverage problem... It is "covered" by the example project. Do you want me to add any more tests to increase code coverage? BTW. I had to increase a timeout for the 'ensure_build' test. |
Thanks. I'll look into this later |
Due to how they are tested, no test coverage is detected even though everything is tested.
…o pr/trejdych/1898
Looking good, Thanks! |
Hello, I'm not sure if it's the correct approach. I'd be happy to hear the feedback.
Closes #1851