Makefile: separate local lint from generated checks#4549
Makefile: separate local lint from generated checks#4549suhas-developer07 wants to merge 2 commits intolima-vm:masterfrom
Conversation
Signed-off-by: suhas-developer07 <[email protected]>
94f3b58 to
03b3eff
Compare
Makefile
Outdated
| protolint . | ||
|
|
||
| .PHONY: lint-ci | ||
| lint-ci: check-generated lint |
There was a problem hiding this comment.
Doesn't seem executed on CI?
Anyway, probably this target is not needed and you can just run make check-generated and make lint on CI instead
There was a problem hiding this comment.
Then again, "check-generated" is the one that is failing if you have made any changes (not only to protobuf)
.PHONY: lint
lint: check-generated
So that would make the whole thing a no-op, and you could just leave it the way it was - at least for CI.
There was a problem hiding this comment.
As far as I know, CI does not run make lint
|
I don't think you need to change anything for CI, I will just add another local target for when you don't want it. Similar to Or I was trying with |
|
Thanks for the clarification — that makes sense I misunderstood how CI invokes linting and assumed make lint was part of the CI flow. Thanks for pointing out that it isn’t. I agree that CI behavior shouldn’t change. Adding a separate local-only target for running the lint commands without check-generated sounds like the right approach. I can update the PR to introduce a local convenience target (e.g. lint-local) that just runs the lint commands, while keeping make lint unchanged. Let me know if that works for you. |
Signed-off-by: suhas-developer07 <[email protected]>
| go-licenses check --include_tests ./... --allowed_licenses=$$(cat ./hack/allowed-licenses.txt) | ||
| ltag -t ./hack/ltag --check -v | ||
| protolint . | ||
|
|
There was a problem hiding this comment.
The code clone has to be eliminated
There was a problem hiding this comment.
Why not just decouple make lint from make check-generated and call it a day?
Summary
This PR separates local linting from CI enforcement.
Changes
make lintnow runs linters without requiring a clean git diffmake lint-cienforcescheck-generatedbefore lintingContext
This addresses the developer experience issue raised in #3994 while preserving the reproducibility guarantees introduced in #3956.
Notes
Local
protolintfailures on generated files are unchanged and out of scope for this PR.