Skip to content

ci: add lint meta-task, fix, and pre-commit hook#16815

Closed
zeitlinger wants to merge 3 commits intoopen-telemetry:mainfrom
zeitlinger:native-lint-tasks
Closed

ci: add lint meta-task, fix, and pre-commit hook#16815
zeitlinger wants to merge 3 commits intoopen-telemetry:mainfrom
zeitlinger:native-lint-tasks

Conversation

@zeitlinger
Copy link
Copy Markdown
Member

@zeitlinger zeitlinger commented Mar 20, 2026

Summary

  • Bump flint from v0.8.0 to v0.9.1
  • Add lint:java task using google-java-format native binary (~42ms for changed files vs minutes via Gradle spotless)
  • Add lint meta-task running links + markdown + java formatting in parallel
  • Add fix task (google-java-format + markdownlint --fix)
  • Add pre-commit + setup:pre-commit-hook tasks via mise generate git-pre-commit
  • CI still runs the full spotlessCheck via Gradle as the authoritative check

Test plan

  • mise run lint passes (links, markdown, java all green)
  • CI passes

@zeitlinger zeitlinger marked this pull request as ready for review March 20, 2026 12:28
@zeitlinger zeitlinger requested a review from a team as a code owner March 20, 2026 12:28
@zeitlinger zeitlinger marked this pull request as draft March 20, 2026 15:26
@zeitlinger zeitlinger marked this pull request as ready for review March 20, 2026 16:09
Comment thread mise.toml
failed=1
fi
done
google-java-format --dry-run --set-exit-if-changed $files || failed=1
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

is this equivalent to running ./gradlew spotlessApply?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

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

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

and it's not doing everything that spotless does - it's a fast subset

Comment thread mise.toml Outdated
Comment thread mise.toml
depends = ["lint"]
[tasks."setup:pre-commit-hook"]
description = "Install git pre-commit hook"
run = "mise generate git-pre-commit --write --task=pre-commit"
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

i'm curious if anyone uses the pre-commit hook? I would find it annoying b/c spotless is so slow on our repo

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

that's why it's a fast subset - see above

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

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.
@zeitlinger zeitlinger marked this pull request as draft April 8, 2026 15:22
@zeitlinger
Copy link
Copy Markdown
Member Author

wait for flint v2

@zeitlinger
Copy link
Copy Markdown
Member Author

close in favor of #17759

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.

2 participants