Skip to content

chore: migrate to flint#267

Merged
zeitlinger merged 32 commits intomainfrom
flint-v2-migration
Apr 27, 2026
Merged

chore: migrate to flint#267
zeitlinger merged 32 commits intomainfrom
flint-v2-migration

Conversation

@zeitlinger
Copy link
Copy Markdown
Member

@zeitlinger zeitlinger commented Apr 9, 2026

Blocked by grafana/flint#205

Summary

  • Replaces super-linter Docker-based linting with the flint binary
  • Adds native linting tools to mise.toml: shellcheck, shfmt, actionlint, editorconfig-checker, prettier, markdownlint-cli2, codespell (+ gofmt via existing go tool)
  • Removes lint:super-linter, lint:links, lint:renovate-deps bash tasks; replaces with flint run
  • Adds .github/config/flint.toml (exclude patterns, renovate-deps config)
  • Adds .markdownlint.jsonc with MD013 disabled

Test plan

  • CI passes (flint run + golangci-lint)
  • mise run lint runs clean locally
  • mise run lint:fix auto-fixes issues

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 bash tasks with the flint v2 binary:
- Add flint binary (branch:feat/flint-v2) and linting tools to mise.toml
- Replace lint:super-linter/links/renovate-deps tasks with flint run
- Add FLINT_CONFIG_DIR env var, lint:fix and lint:pre-commit tasks
- Add .github/config/flint.toml with exclude patterns and renovate-deps config
- Add .markdownlint.jsonc (MD013 disabled — long lines in tables/links)
- Delete .github/config/super-linter.env
- Pin renovate preset to v0.9.2
- Regenerate renovate-tracked-deps.json
- Update AGENTS.md and CONTRIBUTING.md for new task names
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 added a commit that referenced this pull request Apr 21, 2026
## Summary
- update the Java supported-library loader to handle the current
upstream `instrumentation-list.yaml` list format
- keep compatibility with the older mapped representation used
internally by otel-checker
- add test coverage for the new list-based YAML shape

## Why
The `check` job was failing on both `#267` and `#279` because upstream
`open-telemetry/opentelemetry-java-instrumentation` changed
`docs/instrumentation-list.yaml` from a map shape to a list shape.
`otel-checker` still assumed the old format and
`TestFindSupportedLibrary` started failing.

## Verification
- `go test ./checks/sdk/java`
- `mise run check`
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 15:33
@zeitlinger zeitlinger requested a review from a team as a code owner April 21, 2026 15:33
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>
Copy link
Copy Markdown
Member

@martincostello martincostello left a comment

Choose a reason for hiding this comment

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

Do we need to make lint required? It's currently not enforced to merge.

Signed-off-by: Gregor Zeitlinger <gregor.zeitlinger@grafana.com>
@zeitlinger
Copy link
Copy Markdown
Member Author

Do we need to make lint required? It's currently not enforced to merge.

added and checked all other repos too

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 draft April 24, 2026 15:02
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 changed the title chore: migrate to flint v2 chore: migrate to flint Apr 27, 2026
@zeitlinger zeitlinger marked this pull request as ready for review April 27, 2026 16:40
@zeitlinger zeitlinger merged commit 7c0f64b into main Apr 27, 2026
11 checks passed
@zeitlinger zeitlinger deleted the flint-v2-migration branch April 27, 2026 16:41
zeitlinger added a commit that referenced this pull request Apr 28, 2026
Small follow-up to #267.

Updates the generated Flint PR workflow env to pass the vars current
Rust Flint actually reads for GitHub link remaps:
- `GITHUB_REPOSITORY`
- `GITHUB_BASE_REF`
- `GITHUB_HEAD_REF`
- `PR_HEAD_REPO`

and removes stale `GITHUB_HEAD_SHA`, which Rust Flint no longer uses.
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