Skip to content

fix: fail native lint when enabled tools are missing#111

Merged
zeitlinger merged 2 commits intomainfrom
fail-on-missing-native-tools
Mar 17, 2026
Merged

fix: fail native lint when enabled tools are missing#111
zeitlinger merged 2 commits intomainfrom
fail-on-missing-native-tools

Conversation

@zeitlinger
Copy link
Copy Markdown
Member

Summary

  • Native lint mode now fails when enabled linters are missing instead of
    silently skipping them with a warning
  • Prints actionable message: Run mise run setup:native-lint-tools to install them
  • This prevents commits from passing the pre-commit hook when linters can't
    actually run (e.g. when setup:native-lint-tools failed due to a missing
    version file)

Context

Discovered via prometheus/client_java#1945
where CONTRIBUTING.md had a 282-char line that passed the pre-commit hook
because editorconfig-checker wasn't installed (the v8.5.0.toml version
file was missing from flint, so setup:native-lint-tools couldn't install
tools).

Test plan

  • Verify CI passes (shellcheck, super-linter)
  • Test native mode with a missing tool — should now fail with actionable
    message instead of a warning

Previously, missing native lint tools were silently skipped with a
warning, allowing commits to pass the pre-commit hook even when
linters couldn't run. Now missing tools are treated as failures
with a message pointing to `mise run setup:native-lint-tools`.
Signed-off-by: Gregor Zeitlinger <gregor.zeitlinger@grafana.com>
Copilot AI review requested due to automatic review settings March 16, 2026 10:48
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

This PR updates the native lint workflow to fail fast when required native linter tools are missing, preventing false “pass” results in pre-commit/CI scenarios where linters can’t actually run.

Changes:

  • Treat missing native linter executables as failures (not just warnings) in super-linter.sh.
  • Print an actionable install hint for missing native tools.
  • Update AGENTS.md to reflect the new native lint behavior.

Reviewed changes

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

File Description
tasks/lint/super-linter.sh Converts “missing tool” from skip/warn into a failing condition with an install instruction.
AGENTS.md Documents that native mode now fails when enabled tools are missing.

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

Use separate arrays for skipped tool names and flags so the
"Missing native lint tools" message shows actual tool binaries
(e.g. shellcheck, prettier) while _failed still tracks flags
for the summary.
@zeitlinger zeitlinger requested a review from a team as a code owner March 16, 2026 18:58
@zeitlinger zeitlinger merged commit 163bb6b into main Mar 17, 2026
8 checks passed
@zeitlinger zeitlinger deleted the fail-on-missing-native-tools branch March 17, 2026 11:49
zeitlinger pushed a commit that referenced this pull request Mar 19, 2026
🤖 I have created a release *beep* *boop*
---


## [0.9.0](v0.8.0...v0.9.0)
(2026-03-19)


### Features

* support NATIVE env var for container-free linting
([#107](#107))
([0a8193d](0a8193d))


### Bug Fixes

* decouple version mapping generation from pinned super-linter version
([#112](#112))
([5370e77](5370e77))
* fail native lint when enabled tools are missing
([#111](#111))
([163bb6b](163bb6b))
* tighten markdownlint config for native mode
([#106](#106))
([6ef25b2](6ef25b2))

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

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
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