mochengqian opened a new pull request, #964:
URL: https://github.com/apache/dubbo-go-pixiu/pull/964

   ## Summary
   
   Closes #945.
   
   The project already runs `staticcheck` through `golangci-lint` in CI, but 
`.golangci.yaml` globally excluded `SA1019` (the deprecated-symbol-usage rule). 
This PR removes that exclusion so new uses of deprecated symbols are caught, 
while relying on the existing `issues.new: true` gate so only newly changed 
code is checked — pre-existing third-party deprecations are left untouched (per 
the issue's out-of-scope rule against a large unrelated cleanup).
   
   - **`.golangci.yaml`** — remove the `SA1019:` exclusion block. Combined with 
`issues.new: true`, CI fails only on *newly introduced* deprecated usage.
   - **`pkg/filter/http/remote/call.go`** — narrow `//nolint:staticcheck // 
SA1019` on the intentional `AutoResolve` read (the field is read specifically 
to reject the removed option), with an explanatory comment.
   - **`Makefile`** — add a `make lint` target (mirrors the existing 
`check-import-format` pattern) with an install hint pinned to `golangci-lint 
v2.4.0` (matching CI).
   - **`README.md`** — add a short Linting note under *Community & 
Contribution* documenting the gate and how to suppress an intentional usage.
   
   ## Scope notes
   
   - Raw `staticcheck -checks=SA1019 ./...` reports ~84 hits, but ~40 are in 
generated `.pb.go` files (golangci-lint's generated-file exclusion already 
drops these) and ~31 are pre-existing third-party deprecations 
(`grpc.DialContext`, `jhump/protoreflect`, `jwt.StandardClaims`, 
`golang/protobuf`, `otel/jaeger`). None of these block PRs under `new: true`.
   - The only in-repo cross-package deprecated read is `AutoResolve`, now 
annotated.
   - This intentionally does **not** delete deprecated APIs or fix unrelated 
staticcheck categories.
   
   ## Test plan
   
   - [x] `golangci-lint run` on a clean tree → `0 issues`
   - [x] `go build ./...` succeeds
   - [x] `go test ./pkg/filter/http/remote/...` passes (the annotated package)
   - [x] Verified the gate fails on a *newly introduced* deprecated call: on a 
scratch branch with this config plus a new `grpc.DialContext` line committed, 
both bare `new: true` and `--new-from-merge-base=develop` flag exactly that 
line and ignore pre-existing usages.
   - [x] `make lint` runs golangci-lint locally


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to