Skip to content

chore(lint): enable errcheck via golangci-lint#231

Merged
xytan0056 merged 1 commit into
mainfrom
chore/enable-errcheck
Jul 22, 2026
Merged

chore(lint): enable errcheck via golangci-lint#231
xytan0056 merged 1 commit into
mainfrom
chore/enable-errcheck

Conversation

@xytan0056

@xytan0056 xytan0056 commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Add .golangci.yml with errcheck enabled (production code only, tests excluded)
  • Exclude os.RemoveAll, io.WriteString, and zap.Logger.Sync from errcheck — these are fire-and-forget by convention
  • Fix all 16 unchecked error returns across controller, core, and example packages
  • Add make lint target
  • Generate MockSourceHasher test mock (migrated from github.com/golang/mock to go.uber.org/mock) because errcehck needs source to determine err handling

Test plan

CI

@xytan0056
xytan0056 requested review from a team as code owners July 22, 2026 08:31
@xytan0056
xytan0056 force-pushed the chore/enable-errcheck branch 5 times, most recently from 2d0800c to bc60000 Compare July 22, 2026 09:10
Comment thread Makefile Outdated
@echo " make test-integration - Run integration tests (slow)"
@echo " make bench - Run GetChangedTargets benchs (measurement only, not in CI)"
@echo " make bench - Run GetChangedTargets benchs (measurement only, not in CI)"
@echo " make lint - Run golangci-lint (errcheck)"

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.

Suggested change
@echo " make lint - Run golangci-lint (errcheck)"
@echo " make lint - Run golangci-lint"

@sywhang

sywhang commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

might wanna rebase, there's some code changes that went into storage/disk

)

gomock(
name = "mock_sourcehasher",

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

inevitable, becuase errcheck needs source checked in to determine err handling

@xytan0056
xytan0056 force-pushed the chore/enable-errcheck branch from bc60000 to d1986f4 Compare July 22, 2026 17:28
@xytan0056
xytan0056 merged commit 0c88858 into main Jul 22, 2026
20 of 24 checks passed
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