-
Notifications
You must be signed in to change notification settings - Fork 19
fix(204): add #nullable enabled directive on top of generated file
#205
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
base: main
Are you sure you want to change the base?
fix(204): add #nullable enabled directive on top of generated file
#205
Conversation
This avoid CS8669 warnings Signed-off-by: backtrack5r3 <flennertom@gmail.com>
Summary of ChangesHello @tomflenner, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request enhances the robustness of the C# code generation process by addressing a common compilation issue related to nullable reference types. By injecting the Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
14c4a38 to
d90ae5b
Compare
#nullable enabled directive on top of generated file#nullable enabled directive on top of generated file
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.
Code Review
This pull request adds the #nullable enable directive to the top of generated C# files to enable explicit nullable annotations. This resolves CS8669 compilation errors in projects with <TreatWarningsAsErrors>true enabled. The change is applied to the template and existing generated files.
| @@ -1,4 +1,5 @@ | |||
| // AUTOMATICALLY GENERATED BY OPENFEATURE CLI, DO NOT EDIT. | |||
| #nullable enable | |||
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.
This directive enables nullable reference types in C#. It's good practice to include a comment explaining why this is necessary for maintainability.
Consider adding a brief comment to explain the purpose of this directive.
#nullable enable // Enable nullable reference types to ensure null-safety in generated code
This PR
Adds
#nullable enabledirective at the top of the generated C# file to provide explicit nullable annotations context required by the compiler.This resolves CS8669 compilation errors that occur when using the generated code in projects with
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>enabled.Related Issues
Fixes #204
Notes
#nullable enabledirective is added to the beginning ofOpenFeature.g.csHow to test
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>in the.csprojfile