-
Notifications
You must be signed in to change notification settings - Fork 24
chore(core): Linter fixes #2971
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?
Conversation
mostly add nolints for deprecated things
Summary of ChangesHello @dmihalcik-virtru, 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 primarily addresses linter warnings throughout the project by strategically adding Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. 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. Old code whispers low, Linter flags, a gentle plea, Nolint stills the hum. Footnotes
|
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 primarily addresses linter warnings by adding nolint directives for deprecated code, which is justified for backward compatibility and in test/example code. It also includes valuable performance improvements by replacing string concatenation with strings.Builder and migrating to the math/rand/v2 package. The code has also been slightly reformatted in places to adhere to linter rules.
I've identified a couple of minor issues where nolint directives are used to suppress warnings that could be addressed by refactoring the code for better clarity and removing dead code. My comments provide more details on these specific cases.
Overall, these are good maintenance changes that improve the codebase.
| //nolint:staticcheck // SA4010: simplified test code, result intentionally unused | ||
| allBytes = append([]byte{}, bytes...) // Segment 0 goes first | ||
| for j := 1; j < segmentCount; j++ { | ||
| allBytes = append(allBytes, make([]byte, 0)...) // Placeholder | ||
| } | ||
| } else { | ||
| // This is simplified - in practice you'd need proper ordering | ||
| //nolint:staticcheck // SA4010: simplified test code, result intentionally unused | ||
| allBytes = append(allBytes, bytes...) |
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.
Instead of adding nolint directives to suppress the SA4010 warning, it would be better to remove the associated dead code. The allBytes variable is built up within this loop but is never used afterward, making this block of code and its associated comments confusing and unnecessary. Removing this logic would improve the test's clarity.
| //nolint:unparam // Return value is always false but kept for potential future use and consistency | ||
| func (suite *ChainContractTestSuite) handleConnectionErrors(t *testing.T, err error) bool { |
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.
The unparam linter warning is being suppressed, but it points to a valid issue. The function handleConnectionErrors's boolean return value is effectively unused because t.Skipf terminates the test execution, making the return true statement unreachable. The function always returns false in all other paths. It would be cleaner to refactor this function to not return a boolean value and adjust the call site accordingly. This would make the code clearer and remove the need for a nolint directive.
Benchmark results, click to expandBenchmark authorization.GetDecisions Results:
Benchmark authorization.v2.GetMultiResourceDecision Results:
Benchmark Statistics
Bulk Benchmark Results
TDF3 Benchmark Results:
NANOTDF Benchmark Results:
|
Benchmark results, click to expandBenchmark authorization.GetDecisions Results:
Benchmark authorization.v2.GetMultiResourceDecision Results:
Benchmark Statistics
Bulk Benchmark Results
TDF3 Benchmark Results:
NANOTDF Benchmark Results:
|
Proposed Changes
Checklist
Testing Instructions