Skip to content

fix: native lint in worktrees, trust toml, use ec binary, drop isort#134

Merged
zeitlinger merged 7 commits intomainfrom
fix/native-lint-worktree
Mar 31, 2026
Merged

fix: native lint in worktrees, trust toml, use ec binary, drop isort#134
zeitlinger merged 7 commits intomainfrom
fix/native-lint-worktree

Conversation

@zeitlinger
Copy link
Copy Markdown
Member

@zeitlinger zeitlinger commented Mar 30, 2026

Summary

  • Auto-create .mise.super-linter-*.toml from tracked super-linter-versions/ when it doesn't exist (e.g., in git worktrees), so native lint works without running setup:native-lint-tools first
  • Run mise trust on the auto-created toml so mise env -E doesn't fail due to an untrusted config
  • Surface mise env errors instead of swallowing them with 2>/dev/null
  • Use ec as the binary name for editorconfig-checker in native mode
  • Remove VALIDATE_PYTHON_ISORT (Ruff handles import sorting)
  • Remove unused lint:super-linter-native task (superseded by native-lint)
  • Clarify in AGENTS.md that git pre-commit hook and agent-specific hooks are both optional

Context

Native lint silently skipped all tools in git worktrees because the .mise.super-linter-*.toml file (gitignored, created by setup:native-lint-tools) wasn't present. Even after auto-creating it, mise env -E would fail on the untrusted file. Error output was also suppressed, making failures hard to diagnose.

Test plan

  • Run mise run native-lint in a git worktree — should auto-create and trust the toml, then lint correctly
  • Run mise run native-lint without tools installed — should fail with clear error message
  • Run mise run native-lint in main checkout — should work as before (uses existing toml)

- Auto-create .mise.super-linter-*.toml from tracked version mapping
  when it doesn't exist (e.g., in git worktrees)
- Fail with a clear error message when mise env activation fails
  instead of silently skipping tools
@zeitlinger zeitlinger marked this pull request as ready for review March 30, 2026 17:15
@zeitlinger zeitlinger requested a review from a team as a code owner March 30, 2026 17:15
Copilot AI review requested due to automatic review settings March 30, 2026 17:15
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

Improves the native-lint workflow by making it work out-of-the-box in git worktrees (where the generated .mise.super-linter-*.toml isn’t present) and by failing fast when mise env activation fails instead of silently skipping tooling.

Changes:

  • Auto-creates .mise.super-linter-*.toml from super-linter-versions/<tag>.toml when missing in native mode.
  • Replaces mise env ... || true with explicit failure + user-facing error message when activation fails.

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

Comment thread tasks/lint/super-linter.sh
Comment thread tasks/lint/super-linter.sh Outdated
@zeitlinger zeitlinger marked this pull request as draft March 31, 2026 07:53
@zeitlinger zeitlinger marked this pull request as ready for review March 31, 2026 12:31
@zeitlinger zeitlinger marked this pull request as draft March 31, 2026 12:31
- Run `mise trust` after copying the version toml in worktrees, so
  `mise env -E` doesn't fail due to an untrusted config file
- Remove `2>/dev/null` from `mise env` so activation errors are visible

Signed-off-by: Gregor Zeitlinger <gregor.zeitlinger@grafana.com>
…r-native task

- Update AGENTS.md to mention both git pre-commit hook and agent-specific
  hooks (e.g. Claude Code PreToolUse) as optional automation alternatives
- Remove lint:super-linter-native task, superseded by native-lint

Signed-off-by: Gregor Zeitlinger <gregor.zeitlinger@grafana.com>
docs: clarify lint automation options; remove unused lint:super-linter-native task
Signed-off-by: Gregor Zeitlinger <gregor.zeitlinger@grafana.com>
Signed-off-by: Gregor Zeitlinger <gregor.zeitlinger@grafana.com>
@zeitlinger zeitlinger changed the title fix: native lint in worktrees and fail on mise env errors fix: native lint in worktrees, trust toml, use ec binary, drop isort Mar 31, 2026
- Add textlint and textlint-rule-terminology to version mapping and
  update-super-linter-versions.sh
- Add VALIDATE_NATURAL_LANGUAGE to native lint linter definitions
- Add .textlintrc matching super-linter's config (terminology rule)
- Fix "git" → "Git" in AGENTS.md (caught by textlint)

Signed-off-by: Gregor Zeitlinger <gregor.zeitlinger@grafana.com>
@zeitlinger zeitlinger marked this pull request as ready for review March 31, 2026 13:16
@zeitlinger zeitlinger merged commit 8594bba into main Mar 31, 2026
10 checks passed
@zeitlinger zeitlinger deleted the fix/native-lint-worktree branch March 31, 2026 14:01
zeitlinger pushed a commit that referenced this pull request Apr 1, 2026
🤖 I have created a release *beep* *boop*
---


## [0.9.2](v0.9.1...v0.9.2)
(2026-03-31)


### Bug Fixes

* include staged files in native lint file list
([#135](#135))
([34412d6](34412d6))
* native lint in worktrees, trust toml, use ec binary, drop isort
([#134](#134))
([8594bba](8594bba))
* **renovate-deps:** forward GITHUB_TOKEN as GITHUB_COM_TOKEN
([#132](#132))
([4d6510b](4d6510b))

---
> [!IMPORTANT]
> Close and reopen this PR to trigger CI checks.

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
zeitlinger pushed a commit that referenced this pull request Apr 13, 2026
## 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>
This was referenced Apr 16, 2026
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