Migrate the golangci-lint config to v2#1583
Merged
Conversation
…sensys/gnark into config/golangci-lint/migrate
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR migrates the golangci-lint configuration to v2 format and applies the required code changes to satisfy new linting rules. The migration improves code consistency by enforcing uniform method receiver names and applying logical simplifications.
- Migrated golangci-lint configuration to v2 format
- Fixed method receiver naming to ensure consistency across types
- Applied DeMorgan's law and other logical simplifications
- Updated string formatting to use more efficient methods
Reviewed Changes
Copilot reviewed 54 out of 55 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| test/engine.go | Applied DeMorgan's law to boolean condition |
| test/assert.go | Standardized method receiver name from a to assert |
| std/math/emulated/field_test.go | Applied DeMorgan's law to boolean condition |
| std/algebra/native/sw_bls24315/pairing2.go | Unified method receiver names from c/p to pr |
| std/algebra/native/sw_bls24315/g2.go | Unified method receiver names from P to p |
| std/algebra/native/sw_bls24315/g1.go | Unified method receiver names from P to p |
| std/algebra/native/sw_bls12377/pairing2.go | Unified method receiver names from c/p to pr |
| std/algebra/native/sw_bls12377/hints.go | Fixed reference operations on struct fields |
| std/algebra/native/sw_bls12377/g2.go | Unified method receiver names from P to p |
| std/algebra/native/sw_bls12377/g1.go | Unified method receiver names from P/R to p |
| std/algebra/native/fields_bls12377/e12_pairing.go | Fixed method receiver name from x to e |
| Multiple emulated algebra files | Unified method receiver names to pr |
| internal/smallfields/tinyfield/vector.go | Added nolint comment for acceptable return pattern |
| internal/smallfields/tinyfield/element_test.go | Added missing test case |
| internal/smallfields/tinyfield/element.go | Improved Legendre symbol computation and documentation |
| Multiple constraint files | Unified method receiver names from solver to s and cs to system |
| frontend/cs files | Updated string formatting and added nolint comments |
| examples/rollup/rollup_test.go | Added security comment for acceptable random usage |
| go.mod | Updated dependency versions |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or 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.
Ran
golangci-lint migrateas per https://golangci-lint.run/docs/product/migration-guide/.stylecheckandgosimplehave been subsumed intostaticcheck, and as a result the latter has become a bit more strict.Implemented the req changes for the following rules:
fmt.Fprint(sb, ...)instead ofsb.WriteString(fmt.Sprint(...))The following seemed like more trouble than they were worth so I disabled them:
CONSTANTS_OF_THIS_FORM)