Skip to content

build: replace DeepSource with a stricter, pinned golangci-lint - #341

Merged
meling merged 10 commits into
fix/message-helpers-and-reviewfrom
feature/golangci-lint
Oct 7, 2026
Merged

meling merged 10 commits into
fix/message-helpers-and-reviewfrom
feature/golangci-lint

Conversation

@meling

@meling meling commented Oct 3, 2026

Copy link
Copy Markdown
Member
  • CI pins golangci-lint v2.13.2 and lints all three modules with the same arguments as make lint, without only-new-issues.
  • .golangci.yml adds linters for likely defects: forcetypeassert, errorlint, gocritic diagnostics, nilerr, nilnesserr, unconvert, wastedassign, and others.
  • Fixes what they report, plus the DeepSource findings that still apply: gengorums returns errors to protoc instead of calling log.Fatal, newSession takes its context first, unused test names are blank.
  • Removes .deepsource.toml. VET-V0010 no longer applies since Go 1.22, and SCC-SA4006 was a false positive from Go 1.26's new(expr).

Stack created with GitHub Stacks CLI • Give Feedback 💬

Copilot AI balanced review requested due to automatic review settings October 3, 2026 20:48
@meling
meling added this pull request to stack #338 October 3, 2026 20:48

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟡 Changes recommended

The local lint command does not include CI’s timeout argument despite the stated requirement that both invocations match.

Review effort: Balanced
Findings: 1 Medium severity

Open (1)
What changed in this PR

Replaces DeepSource with expanded, pinned golangci-lint CI checks and resolves the resulting diagnostics.

Changes:

  • Expands golangci-lint defect detection across all modules.
  • Propagates generator validation failures through protoc.
  • Applies lint-driven error handling and cleanup fixes.
File Description
.deepsource.toml Removes DeepSource configuration.
.github/​workflows/​golangci-lint.yml Pins and expands CI linting.
.golangci.yml Enables stricter defect linters.
Makefile Updates the local lint command.
doc/​dev-guide.md Documents lint targets.
cmd/​protoc-gen-gorums/​main.go Returns generation errors to protoc.
cmd/​protoc-gen-gorums/​gengorums/​gorums.go Converts fatal validation failures to errors.
cmd/​protoc-gen-gorums/​gengorums/​gorums_dev.go Propagates development-generation errors.
cmd/​protoc-gen-gorums/​gengorums/​gorums_bundle.go Applies type and conversion simplifications.
internal/​testprotos/​failing_test.go Verifies protoc reports validation reasons.
internal/​testutils/​mock/​mock.go Preserves wrapped errors.
internal/​testutils/​servers/​servers_test.go Removes unused receivers.
internal/​conn/​inbound_manager.go Removes an unnecessary conversion.
internal/​stream/​session.go Reorders session context parameters.
internal/​stream/​inbound.go Updates session construction.
internal/​stream/​outbound.go Updates session construction.
internal/​stream/​testhelpers.go Removes an unused receiver.
internal/​stream/​session_test.go Updates session test calls.
internal/​stream/​channel_test.go Updates session test calls.
internal/​stream/​teardown_deadlock_test.go Updates session test calls.
stream_dedup_inflight_test.go Blanks an unused handler parameter.
stream_dedup_dispatch_test.go Blanks unused handler parameters.
options_test.go Documents an intentional nil-argument pattern.
benchkit/​aggregate_test.go Uses length-based result validation.
benchkit/​summary_test.go Uses length-based result validation.
benchkit/​stats_test.go Uses length-based result validation.
benchkit/​cmd/​sweep/​csvio.go Handles wrapped EOF errors.
benchkit/​cmd/​sweep/​deploy.go Handles wrapped EOF errors.
benchkit/​cmd/​sweep/​degraded.go Simplifies zero initialization.
benchkit/​cmd/​sweep/​offsets.go Safely validates regex matches.
Files not reviewed (1)
  • cmd/protoc-gen-gorums/gengorums/gorums_bundle.go: Generated file

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread Makefile
@meling
meling force-pushed the feature/golangci-lint branch 2 times, most recently from 647058a to a190160 Compare October 3, 2026 21:25
@meling
meling force-pushed the feature/golangci-lint branch 2 times, most recently from 644907c to d48cead Compare October 4, 2026 09:44
@meling
meling force-pushed the feature/golangci-lint branch from d48cead to 7717aaa Compare October 4, 2026 14:42
meling added 10 commits October 7, 2026 19:55
The generator called log.Fatal for a file with several services, a
reserved identifier, or invalid method options, which exits the plugin
from library code. GenerateFile and GenerateDevFiles now return these
errors, and the plugin hands them to protoc, which reports them. Method
options are validated before any code is generated.
newSession took its context after the endpoint and stream, against the
Go convention that a context comes first.
Test helpers and handlers named receivers and parameters they never
use. Leaving them blank shows at a glance which inputs a test ignores.
csvio and deploy compared errors with io.EOF directly, which misses a
wrapped EOF; they now use errors.Is. Percentile checks in tests and the
offset line parser guarded indexing with a nil check, which does not
catch an empty slice; they now check the length. The degraded-node scan
no longer initializes a value that every path overwrites.
Registration errors were formatted with %v, so callers could not match
the underlying protoregistry error.
strconv.ParseInteger[uint32] already returns a uint32.
The bundler asserted a function's type to *types.Signature to read its
receiver; types.Func.Signature returns it without an assertion. It also
converted the formatted source, already a []byte, to []byte.
CI ran golangci-lint at the latest release and reported only issues new
in a pull request, so existing defects stayed hidden and local runs could
disagree with CI. CI now pins v2.13.2 and lints all three modules with the
same arguments as make lint, which now runs the golangci-lint binary.

The configuration adds linters that report likely defects rather than
style: unchecked type assertions, error comparisons that break on
wrapping, gocritic's diagnostic checks, and similar. Tests may compare
errors by identity and assert types unchecked.
golangci-lint in CI now covers the checks worth keeping, and DeepSource
could not be run locally before pushing. Its loop-variable capture check
no longer applies since Go 1.22 gave each iteration its own variable.
@meling
meling force-pushed the feature/golangci-lint branch from 7717aaa to c48c132 Compare October 7, 2026 18:16
@meling
meling merged commit 4c54006 into master Oct 7, 2026
6 checks passed
@meling
meling deleted the feature/golangci-lint branch October 7, 2026 18:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants