feat: add native linting mode and version mapping infrastructure#93
feat: add native linting mode and version mapping infrastructure#93zeitlinger merged 15 commits intomainfrom
Conversation
- Add --native flag to super-linter.sh for fast local dev feedback (subset of linters, changed files only, same env file config) - Add --full flag to lint all files instead of only changed files - Add lint hint on failure suggesting `mise run fix` - Add setup tasks for installing native lint tools (mise -E) - Add version extraction script for super-linter tool versions - Switch flint's own super-linter.env to allow-list pattern - Cache file list per native run to avoid repeated git commands - Warn about unsupported VALIDATE_* flags in native mode Signed-off-by: Gregor Zeitlinger <gregor.zeitlinger@grafana.com>
Signed-off-by: Gregor Zeitlinger <gregor.zeitlinger@grafana.com>
Add pre-commit and setup:pre-commit-hook tasks that use native linting with autofix for fast pre-commit feedback. Document setup for both flint and consuming repos. Signed-off-by: Gregor Zeitlinger <gregor.zeitlinger@grafana.com>
Previously skipped tools were only shown when another linter failed, making it easy to miss that tools like shfmt weren't installed. Signed-off-by: Gregor Zeitlinger <gregor.zeitlinger@grafana.com>
There was a problem hiding this comment.
Pull request overview
This PR adds a “native” execution path to the existing lint:super-linter task so developers can run a subset of Super-Linter-equivalent checks directly on the host, and introduces a version-mapping mechanism (via super-linter-versions/*.toml) to install matching native tool versions with mise.
Changes:
- Add
--native(host-run subset) and--full(lint all files) flags totasks/lint/super-linter.sh, plus a lint failure hint pointing tomise run fix. - Add setup tasks/scripts to fetch/install native linter tool versions aligned with the pinned Super-Linter image.
- Switch this repo’s
super-linter.envto an allow-list style and add an initial Super-Linter version mapping TOML.
Reviewed changes
Copilot reviewed 8 out of 9 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
tasks/lint/super-linter.sh |
Implements --native mode, --full support, env parsing, and shared exit hint behavior. |
tasks/setup/native-lint-tools.sh |
Downloads a version mapping TOML and installs matching native lint tools via mise. |
tasks/setup/update-super-linter-versions.sh |
Generates super-linter-versions/<version>.toml from the upstream Super-Linter repo. |
super-linter-versions/v8.4.0.toml |
Initial tool-version mapping for the pinned Super-Linter release. |
mise.toml |
Adds tasks for native linting and setup/version generation. |
README.md |
Documents native mode behavior and supported linters. |
AGENTS.md |
Updates agent guidance to mention native mode behavior. |
.github/config/super-linter.env |
Converts to allow-list VALIDATE_*=true configuration. |
.gitignore |
Ignores locally-generated .mise.super-linter-*.toml files. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Signed-off-by: Gregor Zeitlinger <gregor.zeitlinger@grafana.com>
- Use mapfile for cached file list (robust for edge cases) - Wire golangci-lint to diff mode via --new-from-rev - Document --full flag in README and AGENTS.md Signed-off-by: Gregor Zeitlinger <gregor.zeitlinger@grafana.com>
|
Hey @martincostello 👋 Your friendly neighborhood AI here — I've been busy adding native linting mode to super-linter.sh so humans can get faster local feedback without waiting for the container. Also snuck in a pre-commit hook and version mapping infrastructure. Would appreciate your eyes on this when you get a chance! |
The config change detection in links.sh treated any mise.toml modification as a config change, triggering a full link check. This caused unnecessary 429 rate limiting on Renovate branches that only bump tool versions. Now mise.toml is checked content-aware: only lychee-related lines (version or task config) trigger a full check. Also lower max_concurrency from 4 to 1 to reduce GitHub rate limiting on legitimate full checks. Signed-off-by: Gregor Zeitlinger <gregor.zeitlinger@grafana.com>
This reverts commit d46b342. Signed-off-by: Gregor Zeitlinger <gregor.zeitlinger@grafana.com>
There was a problem hiding this comment.
Will renovate keep this file fresh?
There was a problem hiding this comment.
Added a generate-super-linter-versions.yml workflow that triggers on Renovate branch pushes when mise.toml changes. It checks if SUPER_LINTER_VERSION was bumped, regenerates the version mapping, and commits it back to the branch — same pattern as generate-protobuf.yml in client_java.
- Convert supported native linters to bullet list (README.md) - Add workflow to regenerate version mapping on Renovate bumps - Refactor _find_files to use array params, eliminating 2 SC2086 suppressions - Add comment explaining why FLINT_REF defaults to main Signed-off-by: Gregor Zeitlinger <gregor.zeitlinger@grafana.com>
Signed-off-by: Gregor Zeitlinger <gregor.zeitlinger@grafana.com>
Instead of defaulting to main, extract the flint commit SHA from task file URLs in the consuming repo's mise.toml. Falls back to main for flint itself where tasks are local paths. Signed-off-by: Gregor Zeitlinger <gregor.zeitlinger@grafana.com>
Signed-off-by: Gregor Zeitlinger <gregor.zeitlinger@grafana.com>
|
@martincostello please check again |
…ile in flint Signed-off-by: Gregor Zeitlinger <gregor.zeitlinger@grafana.com>
|
I was waiting on https://github.com/grafana/grafana-renovate-config/pull/65 so we can drop the new workflow. |
OK - I thought we'd no that as a follow-up. |
Pull out generate-super-linter-versions.yml into a follow-up PR. Until Renovate postUpgradeTasks support lands, document the manual step for regenerating version mappings after super-linter bumps. Signed-off-by: Gregor Zeitlinger <gregor.zeitlinger@grafana.com>
6bec445 to
0980507
Compare
|
@martincostello Pulled out the auto-generation workflow into a follow-up PR (#102) as discussed. This PR now has a |
🤖 I have created a release *beep* *boop* --- ## [0.8.0](v0.7.1...v0.8.0) (2026-03-11) ### Features * add native linting mode and version mapping infrastructure ([#93](#93)) ([24b06da](24b06da)) ### Bug Fixes * add 'mise run fix' hint to lint failure output ([#90](#90)) ([5b4ad5d](5b4ad5d)) * improve link checker reliability against GitHub rate limiting ([#95](#95)) ([7a5282d](7a5282d)) * remap same-repo GitHub URLs to local file paths ([#100](#100)) ([b4feadd](b4feadd)) --- > [!IMPORTANT] > Close and reopen this PR to trigger CI checks. Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Resolve conflicts after #93 merge, taking main's evolved versions for native linting (env var propagation, mise env activation, stricter missing-tool handling) while keeping the automation workflow description in RELEASING.md.
## flint v0.20.0 — Rust rewrite flint has been rewritten from scratch in Rust. The bash + Docker stack is replaced by a fast, cross-platform native binary with no container dependency. ### Highlights - **Native binary** — no Docker, no bash wrappers; runs anywhere mise can install a Rust crate - **Parallel linting** — all checks run concurrently - **Diff-aware** — only checks files changed since the merge base by default (`--full` for everything) - **`flint update`** — migrates obsolete `mise.toml` tool keys automatically (e.g. `ubi:` → `github:`, `npm:markdownlint-cli` → `npm:markdownlint-cli2`) - **`flint hook install`** — installs a pre-commit hook without any mise task knowledge - **New linters**: `gofmt`, `google-java-format`, `ktlint`, `dotnet-format`, `markdownlint-cli2`, `xmllint` (via `cargo:xmloxide`), `license-header` (pure-Rust, no binary) - **Windows support** — ktlint self-executing JAR handled via explicit `java -jar` invocation ### Migration See [AGENTS-V2.md](https://github.com/grafana/flint/blob/main/AGENTS-V2.md) and [README.md](https://github.com/grafana/flint/blob/main/README.md) for full setup instructions. Quick reference for existing consumers: ```toml [tools] # While installing from source (pre-crates.io release): "cargo:https://github.com/grafana/flint" = "branch:main" [env] FLINT_CONFIG_DIR = ".github/config" [tasks.lint] run = "flint run" [tasks."lint:fix"] run = "flint run --fix" ``` Remove: `lint:super-linter`, `lint:links`, `lint:renovate-deps`, `setup:native-lint-tools`, `setup:pre-commit-hook` tasks. Run `flint update` to auto-migrate any obsolete tool keys. > [!NOTE] > The changelog below includes entries from the legacy v1 bash era — see [README-V1.md](https://github.com/grafana/flint/blob/main/README-V1.md) for v1 docs. --- ## [0.20.0](flint-v0.19.0...flint-v0.20.0) (2026-04-13) ### Features * add flint v2 Rust binary ([#139](#139)) ([19f2b25](19f2b25)) * add native linting mode and version mapping infrastructure ([#93](#93)) ([24b06da](24b06da)) * add Renovate shareable preset for consuming repos ([#17](#17)) ([8a06590](8a06590)) * consolidate link checking and add autofix flags ([#7](#7)) ([086a5e9](086a5e9)) * flint update command, explicit JAR flag, v0.20.0 ([#146](#146)) ([b43bf52](b43bf52)) * handle line-number anchors and issue comments globally ([#56](#56)) ([cf751df](cf751df)) * **links:** add GitHub URL remaps for line-number and fragment anchors ([#28](#28)) ([5b59065](5b59065)) * **links:** auto-remap base-branch GitHub URLs to PR branch ([#18](#18)) ([dd6cc61](dd6cc61)) * **renovate:** support SHA-pinned URLs in Renovate preset ([#21](#21)) ([4fd1f28](4fd1f28)) * **super-linter:** default to slim image ([#24](#24)) ([c8eeab8](c8eeab8)) * support NATIVE env var for container-free linting ([#107](#107)) ([0a8193d](0a8193d)) ### Bug Fixes * activate mise environment in native lint mode ([#123](#123)) ([d0fec45](d0fec45)) * add 'mise run fix' hint to lint failure output ([#90](#90)) ([5b4ad5d](5b4ad5d)) * decouple version mapping generation from pinned super-linter version ([#112](#112)) ([5370e77](5370e77)) * **deps:** update rust crate crossterm to 0.29 ([#156](#156)) ([c59ae3e](c59ae3e)) * **deps:** update rust crate similar to v3 ([#160](#160)) ([684be4e](684be4e)) * **deps:** update rust crate toml to v1 ([#161](#161)) ([3aae614](3aae614)) * **deps:** update rust crate toml_edit to 0.25 ([#158](#158)) ([42d9efd](42d9efd)) * exclude GitHub compare links from lychee checks ([#10](#10)) ([e714608](e714608)) * fail native lint when enabled tools are missing ([#111](#111)) ([163bb6b](163bb6b)) * improve link checker reliability against GitHub rate limiting ([#95](#95)) ([7a5282d](7a5282d)) * include staged files in native lint file list ([#135](#135)) ([34412d6](34412d6)) * **links:** add regex anchors to remap patterns ([#19](#19)) ([2e17348](2e17348)) * native lint in worktrees, trust toml, use ec binary, drop isort ([#134](#134)) ([8594bba](8594bba)) * **release-please:** fix footer not appearing on release PRs ([#40](#40)) ([d7a55e4](d7a55e4)) * remap same-repo GitHub URLs to local file paths ([#100](#100)) ([b4feadd](b4feadd)) * **renovate-deps:** forward GITHUB_TOKEN as GITHUB_COM_TOKEN ([#132](#132)) ([4d6510b](4d6510b)) * replace broken release-please PR comment with docs ([#12](#12)) ([817b37d](817b37d)) * run shellcheck on .bats files in native mode ([#137](#137)) ([a4fd3f8](a4fd3f8)) * strip Scroll to Text Fragment anchors in link checks ([#86](#86)) ([b630cdf](b630cdf)) * tighten markdownlint config for native mode ([#106](#106)) ([6ef25b2](6ef25b2)) * use remap instead of exclude for issue comment anchors ([#58](#58)) ([656f355](656f355)) --- > [!IMPORTANT] > Close and reopen this PR to trigger CI checks. Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Summary
--nativeflag tosuper-linter.shfor fast local dev feedback — runs a subset of linters directly on the host using the samesuper-linter.envconfig--fullflag to lint all files instead of only changed files (both native and container modes)mise run fixsetup:native-lint-tools,setup:update-super-linter-versions) for installing and managing native lint tool versions matching the pinned super-linter releasesuper-linter-versions/directory with TOML version mappings consumed bymise install -Esuper-linter.envto allow-list pattern as a role model for consuming reposNative mode details
Native mode parses
super-linter.envand follows the same VALIDATE_/FIX_ logic as super-linter. Supported linters: shellcheck, shfmt, markdownlint, prettier, editorconfig-checker, actionlint, hadolint, golangci-lint, ruff, codespell, biome. UnsupportedVALIDATE_*flags are warned about. Missing tools are skipped with a warning.Test plan
mise run lint:super-linter -- --nativeon flint itselfmise run lint:super-linter -- --native --fullto verify full-file modemise run lint:super-linter -- --native --autofixto verify fix modemise.tomlto this branchmise run lint:super-linter)mise run setup:update-super-linter-versionsextracts correct versions