Skip to content

chore: migrate from flint v1 (super-linter) to flint v2 binary#1251

Merged
zeitlinger merged 29 commits intomainfrom
feat/flint-v2-migration
Apr 21, 2026
Merged

chore: migrate from flint v1 (super-linter) to flint v2 binary#1251
zeitlinger merged 29 commits intomainfrom
feat/flint-v2-migration

Conversation

@zeitlinger
Copy link
Copy Markdown
Member

@zeitlinger zeitlinger commented Apr 8, 2026

Summary

  • Replaces flint v1 HTTP tasks and super-linter with the flint v2 binary
  • Adds .github/config/flint.toml with the repo Java/Kotlin license-header check for the current Grafana SPDX-style header, plus renovate-deps manager exclusions and generated-file excludes
  • Expands mise.toml tools to cover the repo lint stack: flint, google-java-format, ktlint, shellcheck, shfmt, actionlint, prettier, markdownlint-cli2, codespell, editorconfig-checker, hadolint, lychee
  • Replaces Spotless-based formatting with flint-owned linting and updates docs/tasks accordingly
  • Keeps .markdownlint.yaml, enforces Markdown line length via .editorconfig with a CHANGELOG.md exemption, and wraps docs to match the current policy

Copilot AI review requested due to automatic review settings April 8, 2026 15:16
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR migrates repository linting from flint v1’s remote tasks + super-linter to the flint v2 CLI, centralizing lint configuration under .github/config/flint.toml and running lint via mise.

Changes:

  • Replace mise-based remote lint tasks with flint run / flint run --fix.
  • Add flint v2 configuration for license-header checking and renovate-deps behavior.
  • Expand mise.toml tool pins to cover the linters previously executed via super-linter, and update tracked deps accordingly.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

File Description
mise.toml Pins flint v2 and related lint toolchain; switches lint/fix tasks to flint run.
.github/renovate-tracked-deps.json Updates tracked mise tools to reflect the new toolchain pins.
.github/config/super-linter.env Removes the super-linter configuration (no longer used).
.github/config/flint.toml Introduces flint configuration (global excludes, license-header check, renovate-deps settings).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread .github/config/flint.toml Outdated
Comment thread mise.toml Outdated
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>
Signed-off-by: Gregor Zeitlinger <gregor.zeitlinger@grafana.com>
Copilot AI review requested due to automatic review settings April 21, 2026 08:30
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread mise.toml Outdated
Comment thread .github/config/flint.toml Outdated
Signed-off-by: Gregor Zeitlinger <gregor.zeitlinger@grafana.com>
Signed-off-by: Gregor Zeitlinger <gregor.zeitlinger@grafana.com>
Copilot AI review requested due to automatic review settings April 21, 2026 10:23
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated no new comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Signed-off-by: Gregor Zeitlinger <gregor.zeitlinger@grafana.com>
Signed-off-by: Gregor Zeitlinger <gregor.zeitlinger@grafana.com>
Copilot AI review requested due to automatic review settings April 21, 2026 11:42
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 7 out of 7 changed files in this pull request and generated 1 comment.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread .markdownlint.yml Outdated
Signed-off-by: Gregor Zeitlinger <gregor.zeitlinger@grafana.com>
Signed-off-by: Gregor Zeitlinger <gregor.zeitlinger@grafana.com>
Copilot AI review requested due to automatic review settings April 21, 2026 14:21
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 10 out of 10 changed files in this pull request and generated 1 comment.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread .editorconfig Outdated
Signed-off-by: Gregor Zeitlinger <gregor.zeitlinger@grafana.com>
Signed-off-by: Gregor Zeitlinger <gregor.zeitlinger@grafana.com>
Copilot AI review requested due to automatic review settings April 21, 2026 14:52
Signed-off-by: Gregor Zeitlinger <gregor.zeitlinger@grafana.com>
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 9 out of 9 changed files in this pull request and generated no new comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Signed-off-by: Gregor Zeitlinger <gregor.zeitlinger@grafana.com>
Signed-off-by: Gregor Zeitlinger <gregor.zeitlinger@grafana.com>
Copilot AI review requested due to automatic review settings April 21, 2026 15:35
Signed-off-by: Gregor Zeitlinger <gregor.zeitlinger@grafana.com>
Signed-off-by: Gregor Zeitlinger <gregor.zeitlinger@grafana.com>
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 11 out of 12 changed files in this pull request and generated 1 comment.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread AGENTS.md
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 16:08
Copilot AI review requested due to automatic review settings April 21, 2026 16:08
@zeitlinger zeitlinger requested a review from jaydeluca as a code owner April 21, 2026 16:08
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 10 out of 11 changed files in this pull request and generated 3 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread AGENTS.md
Comment thread .github/config/flint.toml
Comment thread mise.toml
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>
Copilot AI review requested due to automatic review settings April 21, 2026 16:22
Signed-off-by: Gregor Zeitlinger <gregor.zeitlinger@grafana.com>
Signed-off-by: Gregor Zeitlinger <gregor.zeitlinger@grafana.com>
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 14 out of 15 changed files in this pull request and generated 2 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread CONTRIBUTING.md Outdated
Comment thread .github/config/flint.toml
Signed-off-by: Gregor Zeitlinger <gregor.zeitlinger@grafana.com>
@zeitlinger zeitlinger enabled auto-merge (squash) April 21, 2026 16:33
@zeitlinger zeitlinger merged commit 25e5341 into main Apr 21, 2026
14 checks passed
@zeitlinger zeitlinger deleted the feat/flint-v2-migration branch April 21, 2026 16: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.

3 participants