Skip to content

feat: migrate to flint v2#1243

Merged
zeitlinger merged 22 commits into
mainfrom
feat/migrate-to-flint-v2
Apr 22, 2026
Merged

feat: migrate to flint v2#1243
zeitlinger merged 22 commits into
mainfrom
feat/migrate-to-flint-v2

Conversation

@zeitlinger
Copy link
Copy Markdown
Member

@zeitlinger zeitlinger commented Apr 7, 2026

Summary

  • Replaces v1 HTTP remote tasks (super-linter, links, renovate-deps) with the flint v2 binary
  • Adds github:grafana/flint = "0.20.3" and the native lint tools needed by this repo to [tools]
  • Migrates RENOVATE_TRACKED_DEPS_EXCLUDE -> .github/config/flint.toml [checks.renovate-deps]
  • Removes v1 wrapper tasks (lint:fast, native-lint, pre-commit, fix, setup:pre-commit-hook) and standardizes on lint / lint:fix
  • Preserves the existing .markdownlint.yaml config path

Notes

  • Tool versions are pinned in mise.toml
  • lint:fix is the canonical autofix task

Test plan

  • mise install installs all tools without errors
  • mise run lint runs successfully
  • mise run lint:fix auto-fixes issues

Copilot AI review requested due to automatic review settings April 7, 2026 13:33
Copy link
Copy Markdown
Contributor

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

Migrates the repository’s linting workflow from flint v1 “remote task” scripts to the flint v2 binary invoked via mise, and moves Renovate tracked-deps exclusions into flint configuration.

Changes:

  • Replaces v1 task file downloads/wrappers with flint run / flint run --fix tasks.
  • Adds flint + detected linters to mise.toml tool list and sets FLINT_CONFIG_DIR.
  • Pins Renovate preset to grafana/flint#v0.9.2 and introduces .github/config/flint.toml renovate-deps exclusions.

Reviewed changes

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

File Description
mise.toml Adds flint v2 and linter tools; rewires lint/fix/pre-commit to use flint run.
.github/renovate.json5 Pins flint Renovate preset to a specific version tag.
.github/config/flint.toml New flint config with renovate-deps manager exclusions.

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

Comment thread mise.toml Outdated
Comment thread mise.toml
Comment thread mise.toml Outdated
Comment thread .github/renovate.json5 Outdated
Copilot AI review requested due to automatic review settings April 8, 2026 11:40
Copy link
Copy Markdown
Contributor

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
Comment thread .github/renovate-tracked-deps.json
Copilot AI review requested due to automatic review settings April 8, 2026 11:49
Copy link
Copy Markdown
Contributor

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.

Copilot AI review requested due to automatic review settings April 8, 2026 12:13
Copy link
Copy Markdown
Contributor

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 6 out of 6 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 AGENTS.md
Comment thread mise.toml
@zeitlinger zeitlinger force-pushed the feat/migrate-to-flint-v2 branch from 52c079b to bb81986 Compare April 8, 2026 13:41
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 v1 HTTP remote tasks with flint v2 binary. Flint now manages all
linter tool installation and orchestration via mise.toml [tools] entries
and `flint run`.

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

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>
Copilot AI review requested due to automatic review settings April 21, 2026 08:46
@zeitlinger zeitlinger force-pushed the feat/migrate-to-flint-v2 branch from bb81986 to f27cf97 Compare April 21, 2026 08:46
Copy link
Copy Markdown
Contributor

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 6 out of 6 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
Comment thread mise.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 11:41
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
Contributor

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 2 comments.


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

Comment thread mise.toml
Comment thread AGENTS.md
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:43
Copy link
Copy Markdown
Contributor

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 8 out of 8 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 .markdownlint.yaml
Comment thread mise.toml
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:04
Copy link
Copy Markdown
Contributor

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 8 out of 8 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:27
@zeitlinger zeitlinger marked this pull request as ready for review April 21, 2026 15:29
@zeitlinger zeitlinger requested a review from a team as a code owner April 21, 2026 15:29
Copy link
Copy Markdown
Contributor

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 8 out of 8 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:55
This reverts commit 0d1a393.
Signed-off-by: Gregor Zeitlinger <gregor.zeitlinger@grafana.com>
Copy link
Copy Markdown
Contributor

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 8 out of 8 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.

@zeitlinger zeitlinger merged commit 9e8de75 into main Apr 22, 2026
17 checks passed
@zeitlinger zeitlinger deleted the feat/migrate-to-flint-v2 branch April 22, 2026 05:28
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