-
Notifications
You must be signed in to change notification settings - Fork 251
chore: add stricter linting #3132
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?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,18 +1,63 @@ | ||
| version: "2" | ||
| run: | ||
| modules-download-mode: readonly | ||
| timeout: 10m | ||
| tests: true | ||
| build-tags: | ||
| - evm | ||
| - e2e | ||
| - docker | ||
| linters: | ||
| enable: | ||
| - asciicheck | ||
| - bidichk | ||
| - bodyclose | ||
| - containedctx | ||
| - contextcheck | ||
| - copyloopvar | ||
| - durationcheck | ||
| - errname | ||
| - errcheck | ||
| - errorlint | ||
| - gocritic | ||
| - govet | ||
| - ineffassign | ||
| - makezero | ||
| - gosec | ||
| - misspell | ||
| - nilerr | ||
| - noctx | ||
| - nolintlint | ||
| - prealloc | ||
| - predeclared | ||
| - reassign | ||
| - revive | ||
| - rowserrcheck | ||
| - sqlclosecheck | ||
| - staticcheck | ||
| - testifylint | ||
| - unconvert | ||
| - unparam | ||
| - unused | ||
| - usestdlibvars | ||
| - wastedassign | ||
| settings: | ||
| errcheck: | ||
| check-type-assertions: true | ||
| check-blank: true | ||
| govet: | ||
| enable-all: true | ||
| disable: | ||
| - fieldalignment | ||
| - shadow | ||
| gocritic: | ||
| enabled-tags: | ||
| - diagnostic | ||
| - style | ||
| - performance | ||
| disabled-checks: | ||
| - hugeParam | ||
| - rangeValCopy | ||
| gosec: | ||
| excludes: | ||
| - G115 | ||
|
|
@@ -21,7 +66,7 @@ linters: | |
| - name: package-comments | ||
| disabled: true | ||
| - name: duplicated-imports | ||
| severity: warning | ||
| severity: error | ||
| - name: exported | ||
| arguments: | ||
| - disableStutteringCheck | ||
|
|
@@ -32,10 +77,28 @@ linters: | |
| - common-false-positives | ||
| - legacy | ||
| - std-error-handling | ||
| rules: | ||
| - path: _test\.go | ||
| linters: | ||
| - prealloc | ||
| - noctx | ||
|
Comment on lines
+80
to
+84
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 Analysis chain🌐 Web query:
💡 Result: golangci-lint v2: exclude/suppress/enforce (paths, rules, linters)1) Enable/disable (enforce which linters run)version: "2"
linters:
default: standard # or: all | none | fast
enable: [gosec]
disable: [dupl]
2) Exclude findings (without skipping analysis) —
|
||
| paths: | ||
| - third_party$ | ||
| - builtin$ | ||
| - examples$ | ||
| disable: | ||
| - containedctx | ||
| - errcheck | ||
| - gocritic | ||
| - nolintlint | ||
| - testifylint | ||
| - thelper | ||
| - tparallel | ||
| - unparam | ||
| - wrapcheck | ||
| issues: | ||
| max-issues-per-linter: 0 | ||
| max-same-issues: 0 | ||
| formatters: | ||
| enable: | ||
| - gci | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -121,7 +121,7 @@ func TestSyncer_BackoffOnDAError(t *testing.T) { | |
| } | ||
|
|
||
| // Run sync loop | ||
| syncer.startSyncWorkers() | ||
| syncer.startSyncWorkers(t.Context()) | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 Analysis chain🏁 Script executed: # Find and read the test file
fd -type f -name "syncer_backoff_test.go" -path "*/block/internal/syncing/*"Repository: evstack/ev-node Length of output: 229 🏁 Script executed: # Find the test file
fd "syncer_backoff_test.go"Repository: evstack/ev-node Length of output: 104 🏁 Script executed: # Read the test file to examine context around the mentioned lines
cat -n block/internal/syncing/syncer_backoff_test.goRepository: evstack/ev-node Length of output: 14114 Pass the cancelable context to At lines 124, 226, and 297, Suggested fix- syncer.startSyncWorkers(t.Context())
+ syncer.startSyncWorkers(ctx)
@@
- syncer.startSyncWorkers(t.Context())
+ syncer.startSyncWorkers(ctx)
@@
- syncer.startSyncWorkers(t.Context())
+ syncer.startSyncWorkers(ctx)🤖 Prompt for AI Agents |
||
| <-ctx.Done() | ||
| syncer.wg.Wait() | ||
|
|
||
|
|
@@ -223,7 +223,7 @@ func TestSyncer_BackoffResetOnSuccess(t *testing.T) { | |
| go syncer.processLoop() | ||
|
|
||
| // Run workers | ||
| syncer.startSyncWorkers() | ||
| syncer.startSyncWorkers(t.Context()) | ||
| <-ctx.Done() | ||
| syncer.wg.Wait() | ||
|
|
||
|
|
@@ -294,7 +294,7 @@ func TestSyncer_BackoffBehaviorIntegration(t *testing.T) { | |
| Return(nil, datypes.ErrBlobNotFound).Once() | ||
|
|
||
| go syncer.processLoop() | ||
| syncer.startSyncWorkers() | ||
| syncer.startSyncWorkers(t.Context()) | ||
| <-ctx.Done() | ||
| syncer.wg.Wait() | ||
|
|
||
|
|
||
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.
🧩 Analysis chain
🏁 Script executed:
Repository: evstack/ev-node
Length of output: 2986
🏁 Script executed:
Repository: evstack/ev-node
Length of output: 735
Conflicting linter configuration disables several newly enabled checks.
Lines 12-43 enable
containedctx,errcheck,gocritic,nolintlint,testifylint, andunparamwhich are then disabled again on lines 90-97. This contradiction also makes the related settings on lines 45-60 (forerrcheckandgocritic) ineffective, undermining the PR's stricter-linting objective.Suggested cleanup (if stricter mode is intended)
🤖 Prompt for AI Agents