Skip to content

Makefile: separate local lint from generated checks#4549

Open
suhas-developer07 wants to merge 2 commits intolima-vm:masterfrom
suhas-developer07:fix-lint-target
Open

Makefile: separate local lint from generated checks#4549
suhas-developer07 wants to merge 2 commits intolima-vm:masterfrom
suhas-developer07:fix-lint-target

Conversation

@suhas-developer07
Copy link

Summary

This PR separates local linting from CI enforcement.

Changes

  • make lint now runs linters without requiring a clean git diff
  • make lint-ci enforces check-generated before linting
  • CI behavior remains strict and unchanged

Context

This addresses the developer experience issue raised in #3994 while preserving the reproducibility guarantees introduced in #3956.

Notes

Local protolint failures on generated files are unchanged and out of scope for this PR.

Makefile Outdated
protolint .

.PHONY: lint-ci
lint-ci: check-generated lint
Copy link
Member

Choose a reason for hiding this comment

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

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

Copy link
Member

@afbjorklund afbjorklund Jan 29, 2026

Choose a reason for hiding this comment

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

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.

Copy link
Member

Choose a reason for hiding this comment

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

As far as I know, CI does not run make lint

@afbjorklund
Copy link
Member

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 make native when you don't want to build all weird architectures (and there is no way to configure anymore)

Or make exe when you just want to build and not want to clean, there could be a target to just run the lint commands.

I was trying with pre-commit, but that mostly made it worse - and not all the lint tools have python versions...

@suhas-developer07
Copy link
Author

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.

go-licenses check --include_tests ./... --allowed_licenses=$$(cat ./hack/allowed-licenses.txt)
ltag -t ./hack/ltag --check -v
protolint .

Copy link
Member

Choose a reason for hiding this comment

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

The code clone has to be eliminated

Copy link
Member

Choose a reason for hiding this comment

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

Why not just decouple make lint from make check-generated and call it a day?

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.

3 participants