ci: migrate to flint v2 for linting#17759
Draft
zeitlinger wants to merge 10 commits intoopen-telemetry:mainfrom
Draft
ci: migrate to flint v2 for linting#17759zeitlinger wants to merge 10 commits intoopen-telemetry:mainfrom
zeitlinger wants to merge 10 commits intoopen-telemetry:mainfrom
Conversation
This was referenced Apr 9, 2026
zeitlinger
added a commit
to grafana/flint
that referenced
this pull request
Apr 10, 2026
## Summary Introduces the `flint` Rust binary: a mise-native lint orchestrator that replaces the v1 bash task scripts. **How it works**: reads installed tools from `mise.toml`, maps them to a built-in check registry, runs checks against changed files (merge-base diff) in parallel. Special checks (lychee links, renovate-deps) are implemented in Rust. ## File breakdown 282 files changed — the count is misleading without context: | Category | Files | |---|---| | `tests/` — e2e test fixtures (70 test cases × ~3-4 files each) | 248 | | `src/` — Rust source | 13 | | Config, docs, CI, Cargo | 21 | The 23 linters covered by e2e tests: actionlint, biome, biome-format, cargo-clippy, cargo-fmt, codespell, dotnet-format, editorconfig-checker, gofmt, golangci-lint, google-java-format, hadolint, ktlint, license-header, lychee, markdownlint-cli2, prettier, renovate-deps, ruff, ruff-format, shellcheck, shfmt, plus general cases. ## What's not in this PR **Deferred features:** - `flint hook install` — installs a git pre-commit hook; replaces the per-repo `mise run setup:pre-commit-hook` task with something self-contained in the CLI - `check_task` / `fix_task` in `flint.toml` — allows a fast script (e.g. regex/Python) as the check with a slow canonical fixer (e.g. Gradle); motivating use case: javaagent's `StaticImportFormatter` - Biome config injection — `--config-path` takes a directory, not a file; needs a directory-injection variant in the registry API **Low-priority linters** (no consuming repo needs them yet): - `merge-conflict-markers` — pure-Rust special check - `dotenv-linter`, `go-mod-tidy`, `xmllint` **Post-merge:** - Bash task scripts (`tasks/lint/`) — retire once consumer PRs are merged - GitHub release / `github:grafana/flint` registration — cut after this PR merges; consumer repos switch from branch tracking to a pinned version ## Consumer migration status All 7 consumer PRs green — validated across Rust, Go, Java, Kotlin, Python, .NET, Shell, Dockerfile: - grafana/mox [#63](grafana/mox#63) - grafana/oats [#272](grafana/oats#272) - grafana/otel-checker [#267](grafana/otel-checker#267) - grafana/grafana-opentelemetry-java [#1251](grafana/grafana-opentelemetry-java#1251) - grafana/docker-otel-lgtm [#1243](grafana/docker-otel-lgtm#1243) - prometheus/client_java [#1988](prometheus/client_java#1988) - open-telemetry/opentelemetry-java-instrumentation [#17759](open-telemetry/opentelemetry-java-instrumentation#17759) ## Test plan - [x] CI passes - [x] `flint list` shows all registry entries with correct installed/missing status - [x] All 7 consumer PRs pass CI Release-As: 0.20.0 --------- Signed-off-by: Gregor Zeitlinger <gregor.zeitlinger@grafana.com>
Replace the v1-era remote bash task and separate markdown lint job with flint v2, which runs all checks (lychee, markdownlint-cli2, google-java-format, ktlint, license-header) from a single binary. - Add flint, google-java-format, ktlint to mise.toml - Create .github/config/flint.toml with license-header check for *.java and *.kt (mirrors spotless config); excludes gradlew, spotless.license.java, CHANGELOG.md, licenses/licenses.md - Add ktlint editorconfig overrides to .editorconfig (mirrors the editorConfigOverride() calls in otel.spotless-conventions.gradle.kts) - Replace reusable-link-check.yml + reusable-markdown-lint-check.yml with a single reusable-lint-check.yml running `mise run lint` - Spotless remains authoritative for formatting; flint provides fast local feedback and CI link/markdown/license checking Signed-off-by: Gregor Zeitlinger <gregor.zeitlinger@grafana.com>
Signed-off-by: Gregor Zeitlinger <gregor.zeitlinger@grafana.com>
Signed-off-by: Gregor Zeitlinger <gregor.zeitlinger@grafana.com>
Signed-off-by: Gregor Zeitlinger <gregor.zeitlinger@grafana.com>
Signed-off-by: Gregor Zeitlinger <gregor.zeitlinger@grafana.com>
Signed-off-by: Gregor Zeitlinger <gregor.zeitlinger@grafana.com>
Signed-off-by: Gregor Zeitlinger <gregor.zeitlinger@grafana.com>
Signed-off-by: Gregor Zeitlinger <gregor.zeitlinger@grafana.com>
Signed-off-by: Gregor Zeitlinger <gregor.zeitlinger@grafana.com>
Signed-off-by: Gregor Zeitlinger <gregor.zeitlinger@grafana.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Blocked by #18114
Summary
google-java-formatandktlintas fast local checks (Spotless remains authoritative for formatting)license-headercheck for*.javaand*.ktfilesreusable-link-check.yml+reusable-markdown-lint-check.ymlinto a singlereusable-lint-check.yml.editorconfigoverrides mirroring theeditorConfigOverride()calls inotel.spotless-conventions.gradle.ktsCloses #16815
Spotless coverage
Spotless stays in Gradle and remains the authoritative formatter. Flint provides fast local feedback for changed files only.
One intentional gap:
StaticImportFormatter(the custom Spotless step that rewrites qualified references likeObjects.requireNonNull(x)into static imports) is not covered by flint'sgoogle-java-formatcheck — no standalone tool does this. Gradle CI still enforces it viaspotlessCheck. A future flint feature (check_task) would allow a fast regex script to detect violations locally, invoking Gradle only when something actually needs fixing.Test plan
mise run lintpasses locally