Conversation
- Added `t.Parallel()` to all test functions across various test files to improve test execution speed by allowing concurrent test execution. - Updated AGENTS.md to include usage instructions for golangci-lint.
…st cases - Updated multiple test files to use `require.NoError` and `require.Error` instead of `assert.NoError` and `assert.Error` for better error handling. - Ensured consistency across test cases in `delete_test.go`, `expr_test.go`, `insert_test.go`, `placeholder_test.go`, `select_test.go`, `statement_test.go`, `update_test.go`, and `where_test.go`. - Improved readability and maintainability of tests by using `require` assertions.
- Updated error handling in insert, update, and select builders to use more concise error messages. - Changed assertions in tests from assert to require for better failure handling. - Refactored SQL generation methods to return named return values for clarity. - Improved documentation comments for various methods to enhance code readability. - Adjusted placeholder handling in SQL generation to ensure proper formatting. - Enhanced pagination logic in the select builder to handle edge cases more effectively.
…der registrations
…d maintainability
There was a problem hiding this comment.
Pull request overview
This PR is a comprehensive refactoring that improves code quality, maintainability, and performance without changing external behavior. It introduces a new linter configuration and addresses numerous linting issues throughout the codebase.
Changes:
- Refactored large functions into smaller, focused helper functions for better readability
- Enhanced test suite with parallel execution (
t.Parallel()) and stricter error handling (requirevsassert) - Improved error handling using
errors.New()for static messages and better performance withstrconv.FormatUint()
Reviewed changes
Copilot reviewed 24 out of 25 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| update.go | Major refactoring: split toSqlRaw() into smaller helper functions (writePrefixes, writeSetClauses, etc.) |
| select.go | Major refactoring: split toSqlRaw() into smaller helper functions, added explicit struct initialization |
| expr.go | Refactored Eq.toSQL() into smaller functions (buildEqExpr, unwrapValue, etc.) for better maintainability |
| delete.go | Error handling improvements, replaced fmt.Errorf() with errors.New(), added nolint comments |
| insert.go | Documentation improvements, error handling updates, added nolint comments |
| statement.go | Documentation improvements (added periods to comments) |
| placeholder.go | Introduced escapedPlaceholder constant, added nolint comments |
| part.go | Minor improvements: named return values, string comparison simplification |
| cte.go | Error handling improvements, multi-line error message formatting, added nolint comments |
| case.go | Documentation improvements, added explicit struct initialization |
| update_test.go | Added t.Parallel() and switched to require for error assertions |
| select_test.go | Added t.Parallel(), improved example functions with proper Output comments |
| insert_test.go | Added t.Parallel() and switched to require for error assertions |
| delete_test.go | Added t.Parallel() and switched to require for error assertions |
| expr_test.go | Added t.Parallel() and switched to require for error assertions |
| cte_test.go | Added t.Parallel(), new test cases for Replace and Delete operations |
| case_test.go | Added t.Parallel() with proper closure handling for subtests |
| squirrel_test.go | Removed unused DBStub code, added t.Parallel() |
| where_test.go | Added t.Parallel(), changed assert.Equal to assert.Empty for better clarity |
| statement_test.go | Added t.Parallel() and switched to require for error assertions |
| placeholder_test.go | Added t.Parallel(), fixed assert.Equal argument order |
| .golangci.yml | New comprehensive linter configuration with strict rules |
| .golangci.yaml | Removed old linter configuration |
| AGENTS.md | New documentation file describing tech stack and linting |
| .gitignore | Added /.serena entry |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.