Repository navigation
chore: add golangci new-code quality gates - #30622
Merged
ibetitsmike merged 3 commits intoOct 13, 2026
Merged
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
jscottmiller
approved these changes
Oct 12, 2026
| InputPrice: nullInt64(999), | ||
| }, | ||
| inputTokens: 1002, // 1002 * 999 = 1_000_998 | ||
| inputTokens: 1002, // 1002 times 999 is 1_000_998. |
Enable gocritic commentedOutCode and a depguard rule that denies log/slog in favor of cdr.dev/slog/v3, and fix the existing hits. Delete commented-out code, reword comments that parse as Go, keep the three log/slog imports that third-party APIs require behind explained nolint directives, and route the GitLab provider's truncated-diff warning through a cdr.dev/slog logger passed from externalauth.
…eep ban Add .golangci.new-code.yaml and `make lint/go/new-code`, which only report issues on lines changed since the merge base with GO_LINT_NEW_CODE_BASE (default origin/main). The pass enables nolintlint with require-explanation and require-specific, errcheck with check-blank, and a forbidigo ban on time.Sleep in _test.go files. The existing tree does not pass these rules, so they gate new code only. `make lint` (and so pre-commit and CI) runs the new target. Both golangci-lint targets pass --allow-serial-runners so `make -j` waits on the shared lock instead of failing. CI compares pull requests against the merge commit's first parent and other events against HEAD, which reports nothing.
golangci-lint matches --new-from-merge-base changed lines against symlink-resolved file paths made relative to PWD. From a checkout reached through a symlink no path matched, so the pass reported nothing even for new violations. Resolve the working directory first.
ibetitsmike
force-pushed
the
mike/golangci-new-code-gates
branch
from
October 13, 2026 07:30
2df37f3 to
cd4736e
Compare
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Stack context: second layer of the Go lint gate stack, built on the exclusion fix below.
Why: adds commented-out code detection and a
log/slogban to the main config, plus a new-code-only pass requiring reasons on lint suppressions, flagging ignored errors (including_, _ = w.Write(...)), and banningtime.Sleepin tests. Fixing the hits surfaced a real bug: GitLab warnings went to the wrong logger. The new-code pass resolves symlinked checkout paths so it does not silently report nothing.Validation: both configs report 0 issues; each seeded violation is caught;
make pre-commitpassed.