feat: auto-regenerate super-linter version mapping on Renovate bumps#102
feat: auto-regenerate super-linter version mapping on Renovate bumps#102zeitlinger wants to merge 25 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 <[email protected]>
Signed-off-by: Gregor Zeitlinger <[email protected]>
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 <[email protected]>
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 <[email protected]>
Signed-off-by: Gregor Zeitlinger <[email protected]>
- 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 <[email protected]>
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 <[email protected]>
This reverts commit d46b342. Signed-off-by: Gregor Zeitlinger <[email protected]>
- 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 <[email protected]>
Signed-off-by: Gregor Zeitlinger <[email protected]>
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 <[email protected]>
Signed-off-by: Gregor Zeitlinger <[email protected]>
…ile in flint Signed-off-by: Gregor Zeitlinger <[email protected]>
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 <[email protected]>
9a9e853 to
5462a5f
Compare
There was a problem hiding this comment.
Pull request overview
Adds automation and developer tooling around the pinned SUPER_LINTER_VERSION, so version mappings and (optionally) local native linting stay aligned with Renovate-driven bumps.
Changes:
- Add a GitHub Actions workflow that regenerates
super-linter-versions/*.tomlon Renovate branch pushes whenSUPER_LINTER_VERSIONchanges. - Add/extend mise tasks and scripts for native linting and for generating/installing native tool version mappings.
- Update documentation and lint configuration to support native mode and pre-commit usage.
Reviewed changes
Copilot reviewed 11 out of 12 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
tasks/setup/update-super-linter-versions.sh |
Generates TOML tool-version mappings by scraping the super-linter repo. |
tasks/setup/native-lint-tools.sh |
Installs native toolchain via mise using the generated version mapping. |
tasks/lint/super-linter.sh |
Adds --native and --full; implements native lint execution and container VALIDATE_ALL_CODEBASE wiring. |
super-linter-versions/v8.4.0.toml |
Adds the version mapping file for the pinned super-linter release. |
mise.toml |
Adds tasks for native linting, mapping generation, and a pre-commit hook generator. |
README.md |
Documents native mode, pre-commit hook setup, and auto-regeneration behavior. |
AGENTS.md |
Updates contributor guidance to describe native mode and pre-commit workflow. |
.gitignore |
Ignores generated .mise.super-linter-*.toml files. |
.github/workflows/generate-super-linter-versions.yml |
New workflow to regenerate and commit version mappings on Renovate bumps. |
.github/renovate-tracked-deps.json |
Tracks the new workflow for Renovate dependency updates. |
.github/config/super-linter.env |
Switches to an allow-list style set of VALIDATE_* flags. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
The global remap of all GitHub /blob/ URLs to raw.githubusercontent.com breaks when the URL points to a directory (GitHub serves these fine via redirect, but raw returns 404). Keep same-repo remaps (build_remap_args) which are safe because those paths exist in the checkout. Remove cross-repo blob remaps from build_global_github_args, keeping only the issue/PR comment anchor stripping. Signed-off-by: Gregor Zeitlinger <[email protected]>
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 <[email protected]>
Add a GitHub Actions workflow that triggers on Renovate branches when mise.toml changes. If SUPER_LINTER_VERSION was bumped, it runs setup:update-super-linter-versions and commits the updated TOML to the same branch. Signed-off-by: Gregor Zeitlinger <[email protected]>
5462a5f to
7f302cf
Compare
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.
- Use git status --porcelain instead of git diff --quiet in workflow so untracked files (first-time TOML generation) are detected - Remove VALIDATE_PYTHON_ISORT (Ruff handles import sorting) - Add --cached to _list_files so staged files are linted in pre-commit - Replace grep -oP (PCRE) with sed for macOS compatibility
- Break long line in workflow to satisfy editorconfig max_line_length - Remove extra blank lines flagged by shfmt
- 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
…iles change links.sh: faulty merge conflict resolution accidentally dropped the cross-repo blob→raw remap logic. Reset to match main. super-linter.sh: move --cached staged-files fix to a separate PR.
| permissions: | ||
| contents: write |
There was a problem hiding this comment.
CI won't run using the default token - we'd need to use a GitHub app.
| git fetch origin main | ||
| if git diff origin/main -- mise.toml | grep -q 'SUPER_LINTER_VERSION'; then |
There was a problem hiding this comment.
Can avoid hard-coding the branch name by using github.event.repository.default_branch from the workflow.
| git config user.name "github-actions[bot]" | ||
| git config user.email "41898282+github-actions[bot]@users.noreply.github.com" |
There was a problem hiding this comment.
These can be derived from the GitHub API for the current PAT, rather than hard-coded.
For example:
app_name="YOUR_GITHUB_APP_NAME"
echo "Git user name: ${app_name}[bot]"
echo "Git user email: $(gh api "/users/${app_name}[bot]" --jq ".id")+${app_name}[bot]@users.noreply.github.com"|
close in favor of #139 |
Will likely close in favor of #139
Summary
super-linter-versions/*.tomlwhen Renovate bumpsSUPER_LINTER_VERSIONinmise.tomlmise run setup:update-super-linter-versionsstep documented in feat: add native linting mode and version mapping infrastructure #93Depends on #93 being merged first.
Blocked on grafana/deployment_tools#521751.
Test plan