-
-
Notifications
You must be signed in to change notification settings - Fork 1
[FEAT] Sonar Issue Fixes & Clean Up #8
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
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅ 📢 Thoughts on this report? Let us know! |
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.
Pull Request Overview
This PR strengthens linting, improves comment consistency, and refactors tests for readability and maintainability.
- Re-enabled and configured additional GolangCI linters.
- Standardized comment annotations (
Note→Attn) and provided specific//nolint:gosecjustifications. - Refactored tests to use a shared error constant and updated test naming.
Reviewed Changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| .golangci.json | Re-enabled linters (err113, gochecknoglobals, godox, etc.) |
| tx_map.go | Swapped “Note” for “Attn” in comments; added detailed nolint tags |
| tx_map_benchmarks_test.go | Introduced errMapShouldNotBeNil constant for duplicated strings |
| tx_map_test.go | Renamed Test_bytes2Uint16 to TestBytes2Uint16 |
| examples/examples.go | Removed “TODO” prefix from placeholder comment |
| .github/labels.yml | Added dependencies label and enriched Docker label description |
Comments suppressed due to low confidence (2)
tx_map_test.go:12
- [nitpick] The test name doesn’t match the function under test (
Bytes2Uint16Buckets). Consider renaming toTestBytes2Uint16Bucketsfor clarity.
func TestBytes2Uint16(t *testing.T) {
examples/examples.go:5
- [nitpick] This placeholder comment doesn’t provide guidance. Either add a real example or restore a TODO with context on what to implement.
// Implement the examples
|



This pull request includes updates to the
.golangci.jsonconfiguration, improvements to comments and error messages intx_map.go, and minor refactoring in test files. The most significant changes involve enabling additional linters, standardizing comment annotations, and improving test readability.Configuration Updates:
.golangci.json: Re-enabled several linters (gochecknoglobals,gomoddirectives,godox,nilnil,nilnesserr,recvcheck, anderr113) to enhance code quality checks. [1] [2]Codebase Improvements:
tx_map.go: Standardized comment annotations by replacing "Note" with "Attn" for consistency and clarity. This was applied across multiple methods and functions. [1] [2] [3] [4] [5]tx_map.go: Updated//nolint:goseccomments to provide specific justifications for skipping linting, such as "integer overflow conversion." [1] [2] [3]Test Refactoring:
tx_map_benchmarks_test.go: Replaced hardcoded error strings with a constant (errMapShouldNotBeNil) to improve maintainability and reduce duplication. [1] [2] [3] [4] [5] [6] [7]tx_map_test.go: RenamedTest_bytes2Uint16toTestBytes2Uint16to follow Go naming conventions for test functions.These changes collectively improve code quality, readability, and maintainability.