Skip to content

chore: migrate from super-linter to flint v2#1988

Merged
zeitlinger merged 39 commits intoprometheus:mainfrom
zeitlinger:feat/flint-v2
Apr 22, 2026
Merged

chore: migrate from super-linter to flint v2#1988
zeitlinger merged 39 commits intoprometheus:mainfrom
zeitlinger:feat/flint-v2

Conversation

@zeitlinger
Copy link
Copy Markdown
Member

@zeitlinger zeitlinger commented Apr 8, 2026

Summary

  • Replaces lint:super-linter, lint:links, and lint:renovate-deps tasks with a single flint run invocation
  • Adds google-java-format via github:google/google-java-format and standard native lint tools through mise
  • Creates .github/config/flint.toml with path exclusions (docs/themes/, src/main/generated/, mvnw, simpleclient-archive/) and migrates RENOVATE_TRACKED_DEPS_EXCLUDE to [checks.renovate-deps] exclude_managers
  • Removes Spotless from the branch; flint does not replace Maven Checkstyle
  • Updates GitHub Actions to mise v2026.4.16 so raw_args = true is supported in the flint-backed lint task

Test plan

  • CI jobs pass
  • mise run lint
  • mise run lint:fix
  • flint run --fix renovate-deps reflected in .github/renovate-tracked-deps.json

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 super-linter, lint:links, and lint:renovate-deps with a single
flint run invocation. Add google-java-format and standard lint tools
(shellcheck, shfmt, prettier, markdownlint-cli2, actionlint,
editorconfig-checker, codespell, ruff) to mise.toml.

flint.toml excludes docs/themes/ (Hugo theme), src/main/generated/
(generated code), and mvnw (generated Maven wrapper with known
shellcheck issues). renovate-deps exclude_managers migrated from the
former RENOVATE_TRACKED_DEPS_EXCLUDE env var.
Signed-off-by: Gregor Zeitlinger <gregor.zeitlinger@grafana.com>
exclude_paths uses prefix matching from the project root, so
"src/main/generated/" did not match the nested path
"prometheus-metrics-exposition-formats/src/main/generated/".
Switch to exclude (regex, substring match) which works for any depth.
Signed-off-by: Gregor Zeitlinger <gregor.zeitlinger@grafana.com>
- .markdownlint.json: disable MD013/MD031/MD033/MD036 (line length,
  fences, inline HTML, emphasis-as-heading — all pre-existing in docs)
- .codespellrc: ignore nd/atmost/re-use/errorprone (false positives in
  Java identifiers and comments)
- .editorconfig: extend workflow exemption to all .github/workflows/*.yml
  at 300 chars; add CODE_OF_CONDUCT.md to high-limit group
- .editorconfig-checker.json: explicitly exclude *.java (handled by
  google-java-format via defer_to_formatters, belt-and-suspenders)
- flint.toml: add simpleclient-archive/ to exclude_paths
- SpanContext.java: fix Examplar → Exemplar typo
- renovate-tracked-deps.json: regenerated (pretty-print normalisation)
- java-version-matrix-tests.yml: prettier quote normalisation
- Metrics.java: google-java-format string split normalisation
Signed-off-by: Gregor Zeitlinger <gregor.zeitlinger@grafana.com>
…markdownlint config

Signed-off-by: Gregor Zeitlinger <gregor.zeitlinger@grafana.com>
Signed-off-by: Gregor Zeitlinger <gregor.zeitlinger@grafana.com>
…ithub: backend

Signed-off-by: Gregor Zeitlinger <gregor.zeitlinger@grafana.com>
Signed-off-by: Gregor Zeitlinger <gregor.zeitlinger@grafana.com>
…tless removal

Signed-off-by: Gregor Zeitlinger <gregor.zeitlinger@grafana.com>
Adds cargo:xmloxide which installs the xmllint binary — validates
well-formedness of all *.xml files (pom.xml, version-rules.xml, etc.).

Also migrates flint.toml from the old exclude/exclude_paths fields to
the new single glob list format (required by current flint v2).

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>
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>
@zeitlinger zeitlinger marked this pull request as ready for review April 21, 2026 14:30
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 reverts commit 88348f7.
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>
@zeitlinger zeitlinger enabled auto-merge (squash) April 22, 2026 09:11
Comment thread .github/config/.editorconfig-checker.json
Comment thread .github/renovate-tracked-deps.json
Comment thread .github/workflows/java-version-matrix-tests.yml
Comment thread README.md Outdated
Comment thread biome.jsonc
Comment thread docs/content/config/config.md Outdated
Signed-off-by: Gregor Zeitlinger <gregor.zeitlinger@grafana.com>
@zeitlinger zeitlinger merged commit 28bb626 into prometheus:main Apr 22, 2026
13 checks passed
@zeitlinger zeitlinger deleted the feat/flint-v2 branch April 22, 2026 15:36
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