Make local golang-lint as same as on the CI
What would you like to be added:
Make local golang lint check as same as on the CI
Why is this needed:
Hello!
It seems that both local and CI are running the same golangci-lint version (v1.64.7) . In CI, reviewdog is used, while docker is used locally.
What exactly does "making local and CI the same" refer to?
Thanks!
FWIW: Another golangci-lint task is migrating golangci-lint v2
FYI: https://ldez.github.io/blog/2025/03/23/golangci-lint-v2/
So based on @Okabe-Junya 's comment and as per the codebase
I'm looking at making the local golang lint check match what's running in CI.
Am I understanding correctly that the task is to ensure local linting matches the CI environment? If so, I'm thinking of updating the Makefile's lint/go target to ensure it uses the exact same linting rules and Go version.
Is this the right approach, or is there something specific about the CI setup I should be aware of?
Thanksss!!!! @khanhtc1202
@khanhtc1202 @t-kikuc i would like work on this
Sorry for the late reply and insufficient information.
We use the reviewdog on our CI, so the lint job fails only when the linter warnings/errors are detected on the changed lines in that PR.
Conversely, we use golangci-lint on our local execution without the new option.
Because of these, results are inconsistent between local and CI.
Even if some warnings/errors are detected on our local execution result, that doesn't mean the CI will fail.
We have two options to resolve this issue. One is a way to make the CI stricter. I.E., make the result a failure even if the warnings/errors are out of diffs. The other way is to loosen the local result. I.E., make the result successful if the warnings/errors are out of diffs.
@t-kikuc @ffjlabo @khanhtc1202 (as a maintainer) @Okabe-Junya @abhinavs1920 @Tushar240503 (as interested in this issue) We have no consensus yet on which to choose, so I want to hear others' opinions. IMO, the latter way, to loosen the local result, is the way to go easy because we can fix the CI by taking care of only the diff in the PR.
@Warashi I think we should go ahead with the second option right away — align local linting with CI by focusing only on diffs. This will provide immediate consistency for developers and reduce friction.
At the same time, we can start planning and working toward making CI stricter as a long-term goal. This way, we’re not blocked by existing warnings, but we’re still improving the overall code quality step by step.