ci: add lint meta-task, fix, and pre-commit hook#16815
ci: add lint meta-task, fix, and pre-commit hook#16815zeitlinger wants to merge 3 commits intoopen-telemetry:mainfrom
Conversation
| failed=1 | ||
| fi | ||
| done | ||
| google-java-format --dry-run --set-exit-if-changed $files || failed=1 |
There was a problem hiding this comment.
is this equivalent to running ./gradlew spotlessApply?
There was a problem hiding this comment.
yes, but only for changed files - spotless has a feature that looks for changed files as well - but it still needs to load the gradle config, so it's not really fast
There was a problem hiding this comment.
and it's not doing everything that spotless does - it's a fast subset
| depends = ["lint"] | ||
| [tasks."setup:pre-commit-hook"] | ||
| description = "Install git pre-commit hook" | ||
| run = "mise generate git-pre-commit --write --task=pre-commit" |
There was a problem hiding this comment.
i'm curious if anyone uses the pre-commit hook? I would find it annoying b/c spotless is so slow on our repo
There was a problem hiding this comment.
that's why it's a fast subset - see above
There was a problem hiding this comment.
what I mean is that it doesn't use gradle at all
Bump flint to v0.9.1. Add lint:spotless wrapping spotlessCheck, a lint meta-task that runs links + markdown + spotless in parallel, a fix task (spotlessApply + markdownlint --fix), and a pre-commit hook via mise generate. Signed-off-by: Gregor Zeitlinger <[email protected]>
…ocal lint Replaces the slow Gradle-based spotlessCheck/spotlessApply (~5min) with google-java-format native binary (~42ms) for changed files only. CI still runs the full spotlessCheck via Gradle.
a9f48a6 to
a46df34
Compare
|
wait for flint v2 |
|
close in favor of #17759 |
Summary
lint:javatask usinggoogle-java-formatnative binary (~42ms for changed files vs minutes via Gradle spotless)lintmeta-task running links + markdown + java formatting in parallelfixtask (google-java-format + markdownlint --fix)pre-commit+setup:pre-commit-hooktasks viamise generate git-pre-commitspotlessCheckvia Gradle as the authoritative checkTest plan
mise run lintpasses (links, markdown, java all green)