fix: the PostgreSQL wrapper is incorrectly generated due to whitespace#10
fix: the PostgreSQL wrapper is incorrectly generated due to whitespace#10
Conversation
|
This change is part of the following stack: Change managed by git-spice. |
Summary of ChangesHello, 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 addresses a subtle but important bug in the code generation process for PostgreSQL database wrappers. By correcting the whitespace trimming logic within a Go template, it ensures that the generated 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. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request fixes an issue where the generated PostgreSQL wrapper had incorrect whitespace, causing the //go:build tag to be on the same line as another comment. The change correctly separates them. I've added a suggestion to further improve the formatting of the generated code to better align with standard Go style conventions for build tags.
| {{if .Engine.IsPostgres}} | ||
| //go:build !js | ||
|
|
||
| {{end -}} | ||
| {{- end -}} |
There was a problem hiding this comment.
While this change fixes the issue of the build tag being on the same line, the resulting generated code will have a blank line before the build tag, which is unconventional. For better adherence to Go styling conventions, it's recommended to place the build tag on the line immediately following the 'generated code' comment, followed by a blank line before the package declaration. This can be achieved by adjusting the template whitespace handling.
| {{if .Engine.IsPostgres}} | |
| //go:build !js | |
| {{end -}} | |
| {{- end -}} | |
| {{if .Engine.IsPostgres}}//go:build !js | |
| {{end -}} |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #10 +/- ##
=======================================
Coverage 28.83% 28.83%
=======================================
Files 6 6
Lines 697 697
=======================================
Hits 201 201
Misses 485 485
Partials 11 11 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
No description provided.