From 4df3ecc27cd528aa25de99efadbd1002866d7cc5 Mon Sep 17 00:00:00 2001 From: Gregor Zeitlinger Date: Tue, 3 Mar 2026 10:45:12 +0000 Subject: [PATCH 1/6] fix: add 'mise run fix' hint to lint failure output When a lint task fails, print a hint suggesting `mise run fix` to help users discover the autofix workflow. The hint is suppressed during AUTOFIX mode to avoid circular advice. Closes #89 Signed-off-by: Gregor Zeitlinger --- tasks/lint/renovate-deps.py | 10 ++++++++++ tasks/lint/super-linter.sh | 18 ++++++++++++++---- 2 files changed, 24 insertions(+), 4 deletions(-) diff --git a/tasks/lint/renovate-deps.py b/tasks/lint/renovate-deps.py index eacc028..a46c1e6 100755 --- a/tasks/lint/renovate-deps.py +++ b/tasks/lint/renovate-deps.py @@ -132,6 +132,11 @@ def is_true(var): "Run 'mise run lint:renovate-deps --autofix' to create it.", file=sys.stderr, ) + print( + "\n💡 Try `mise run fix` to auto-fix lint issues," + " then re-run `mise run lint` to verify.", + file=sys.stderr, + ) sys.exit(1) else: committed_data = json.loads(COMMITTED.read_text()) @@ -163,6 +168,11 @@ def normalize(d): "Run 'mise run lint:renovate-deps' with AUTOFIX=true to update.", file=sys.stderr, ) + print( + "\n💡 Try `mise run fix` to auto-fix lint issues," + " then re-run `mise run lint` to verify.", + file=sys.stderr, + ) sys.exit(1) diff --git a/tasks/lint/super-linter.sh b/tasks/lint/super-linter.sh index 6793005..f43e537 100755 --- a/tasks/lint/super-linter.sh +++ b/tasks/lint/super-linter.sh @@ -10,6 +10,17 @@ if [ "${usage_autofix:-}" = "true" ]; then AUTOFIX=true fi +_on_exit() { + local ec=$? + rm -f "${_FILTERED_ENV_FILE:-}" + if [ $ec -ne 0 ] && [ "${AUTOFIX:-}" != "true" ]; then + # shellcheck disable=SC2016 # backticks are intentional: literal formatting, not command substitution + printf '\n💡 Try `mise run fix` to auto-fix lint issues, then re-run `mise run lint` to verify.\n' + fi + exit $ec +} +trap _on_exit EXIT + # check for required env vars, otherwise exit with error if [ -z "${SUPER_LINTER_VERSION:-}" ]; then echo "SUPER_LINTER_VERSION environment variable is not set. Exiting." @@ -40,10 +51,9 @@ fi ENV_FILE="${SUPER_LINTER_ENV_FILE:-.github/config/super-linter.env}" if [ "${AUTOFIX:-}" != "true" ]; then # Filter out FIX_* and comment lines when not auto-fixing - FILTERED_ENV_FILE=$(mktemp) - trap 'rm -f "$FILTERED_ENV_FILE"' EXIT - grep -v '^#' "$ENV_FILE" | grep -v '^FIX_' >"$FILTERED_ENV_FILE" - ENV_FILE="$FILTERED_ENV_FILE" + _FILTERED_ENV_FILE=$(mktemp) + grep -v '^#' "$ENV_FILE" | grep -v '^FIX_' >"$_FILTERED_ENV_FILE" + ENV_FILE="$_FILTERED_ENV_FILE" fi $RUNTIME image pull -q --platform linux/amd64 "ghcr.io/super-linter/super-linter:${SUPER_LINTER_VERSION}" >/dev/null From 2188461cc7fc2b9260b6026356dd7b13dec77e0b Mon Sep 17 00:00:00 2001 From: Gregor Zeitlinger Date: Thu, 5 Mar 2026 13:40:02 +0000 Subject: [PATCH 2/6] fix: address review comments on lint hint PR - Guard rm -f with non-empty check for _FILTERED_ENV_FILE - Only show 'mise run fix' hint when linter actually ran, not on config/runtime failures (missing env vars, container pull errors) - Fix ruff formatting in renovate-deps.py Signed-off-by: Gregor Zeitlinger --- tasks/lint/renovate-deps.py | 4 +++- tasks/lint/super-linter.sh | 9 +++++++-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/tasks/lint/renovate-deps.py b/tasks/lint/renovate-deps.py index a46c1e6..052b0e9 100755 --- a/tasks/lint/renovate-deps.py +++ b/tasks/lint/renovate-deps.py @@ -163,7 +163,9 @@ def normalize(d): f.write("\n") print("renovate-tracked-deps.json has been updated.") else: - print("ERROR: renovate-tracked-deps.json is out of date.", file=sys.stderr) + print( + "ERROR: renovate-tracked-deps.json is out of date.", file=sys.stderr + ) print( "Run 'mise run lint:renovate-deps' with AUTOFIX=true to update.", file=sys.stderr, diff --git a/tasks/lint/super-linter.sh b/tasks/lint/super-linter.sh index f43e537..d93dbcc 100755 --- a/tasks/lint/super-linter.sh +++ b/tasks/lint/super-linter.sh @@ -10,10 +10,14 @@ if [ "${usage_autofix:-}" = "true" ]; then AUTOFIX=true fi +_LINTER_RAN=false + _on_exit() { local ec=$? - rm -f "${_FILTERED_ENV_FILE:-}" - if [ $ec -ne 0 ] && [ "${AUTOFIX:-}" != "true" ]; then + if [ -n "${_FILTERED_ENV_FILE:-}" ]; then + rm -f -- "$_FILTERED_ENV_FILE" + fi + if [ $ec -ne 0 ] && [ "$_LINTER_RAN" = "true" ] && [ "${AUTOFIX:-}" != "true" ]; then # shellcheck disable=SC2016 # backticks are intentional: literal formatting, not command substitution printf '\n💡 Try `mise run fix` to auto-fix lint issues, then re-run `mise run lint` to verify.\n' fi @@ -58,6 +62,7 @@ fi $RUNTIME image pull -q --platform linux/amd64 "ghcr.io/super-linter/super-linter:${SUPER_LINTER_VERSION}" >/dev/null +_LINTER_RAN=true $RUNTIME container run --rm --platform linux/amd64 \ -e RUN_LOCAL=true \ -e DEFAULT_BRANCH=main \ From 4f3c6266cb31ac5ee0f0d5d0d792dad2523acec3 Mon Sep 17 00:00:00 2001 From: Gregor Zeitlinger Date: Thu, 5 Mar 2026 16:20:32 +0000 Subject: [PATCH 3/6] fix: format renovate-deps.py with line-length 120 Super-Linter applies its own .ruff.toml with line-length=120. Local ruff defaults to 88, causing format mismatches. Signed-off-by: Gregor Zeitlinger --- tasks/lint/renovate-deps.py | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/tasks/lint/renovate-deps.py b/tasks/lint/renovate-deps.py index 052b0e9..6d69bb4 100755 --- a/tasks/lint/renovate-deps.py +++ b/tasks/lint/renovate-deps.py @@ -133,8 +133,7 @@ def is_true(var): file=sys.stderr, ) print( - "\n💡 Try `mise run fix` to auto-fix lint issues," - " then re-run `mise run lint` to verify.", + "\n💡 Try `mise run fix` to auto-fix lint issues, then re-run `mise run lint` to verify.", file=sys.stderr, ) sys.exit(1) @@ -163,16 +162,13 @@ def normalize(d): f.write("\n") print("renovate-tracked-deps.json has been updated.") else: - print( - "ERROR: renovate-tracked-deps.json is out of date.", file=sys.stderr - ) + print("ERROR: renovate-tracked-deps.json is out of date.", file=sys.stderr) print( "Run 'mise run lint:renovate-deps' with AUTOFIX=true to update.", file=sys.stderr, ) print( - "\n💡 Try `mise run fix` to auto-fix lint issues," - " then re-run `mise run lint` to verify.", + "\n💡 Try `mise run fix` to auto-fix lint issues, then re-run `mise run lint` to verify.", file=sys.stderr, ) sys.exit(1) From 20d9cb8fe241df6a163704d53fe0631e3bf527c0 Mon Sep 17 00:00:00 2001 From: Gregor Zeitlinger Date: Thu, 5 Mar 2026 16:27:10 +0000 Subject: [PATCH 4/6] fix: satisfy both pylint (max 100) and ruff (max 120) Split hint strings to stay under pylint's 100-char limit. Add fmt:skip to prevent ruff from rejoining them at 120. Signed-off-by: Gregor Zeitlinger --- tasks/lint/renovate-deps.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tasks/lint/renovate-deps.py b/tasks/lint/renovate-deps.py index 6d69bb4..cf63d75 100755 --- a/tasks/lint/renovate-deps.py +++ b/tasks/lint/renovate-deps.py @@ -133,7 +133,8 @@ def is_true(var): file=sys.stderr, ) print( - "\n💡 Try `mise run fix` to auto-fix lint issues, then re-run `mise run lint` to verify.", + "\n💡 Try `mise run fix` to auto-fix lint issues," # fmt: skip + " then re-run `mise run lint` to verify.", file=sys.stderr, ) sys.exit(1) @@ -168,7 +169,8 @@ def normalize(d): file=sys.stderr, ) print( - "\n💡 Try `mise run fix` to auto-fix lint issues, then re-run `mise run lint` to verify.", + "\n💡 Try `mise run fix` to auto-fix lint issues," # fmt: skip + " then re-run `mise run lint` to verify.", file=sys.stderr, ) sys.exit(1) From 84075174c2222ef7cd1082fe7a6090505475777d Mon Sep 17 00:00:00 2001 From: Gregor Zeitlinger Date: Thu, 5 Mar 2026 16:28:54 +0000 Subject: [PATCH 5/6] fix: replace pylint/isort with ruff in super-linter Ruff covers the same rules as pylint and isort, and was already used for formatting. Having both caused line-length conflicts (pylint: 100, ruff: 120). Disable pylint and isort, enable ruff lint autofix, and remove fmt:skip workarounds. Signed-off-by: Gregor Zeitlinger --- .github/config/super-linter.env | 6 ++++-- tasks/lint/renovate-deps.py | 6 ++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/config/super-linter.env b/.github/config/super-linter.env index bb9a35e..d04b1f4 100644 --- a/.github/config/super-linter.env +++ b/.github/config/super-linter.env @@ -8,8 +8,10 @@ VALIDATE_GIT_COMMITLINT=false VALIDATE_JSCPD=false # Use Biome instead of Prettier for JSON formatting (Biome uses tabs, Prettier uses spaces) VALIDATE_JSON_PRETTIER=false -# Use Ruff instead of Black for Python formatting +# Use Ruff instead of Black/Pylint/isort for Python VALIDATE_PYTHON_BLACK=false +VALIDATE_PYTHON_PYLINT=false +VALIDATE_PYTHON_ISORT=false # Enable auto-fix for relevant linters FIX_BIOME_FORMAT=true @@ -18,7 +20,7 @@ FIX_JSONC=true FIX_MARKDOWN=true FIX_MARKDOWN_PRETTIER=true FIX_NATURAL_LANGUAGE=true -FIX_PYTHON_ISORT=true +FIX_PYTHON_RUFF=true FIX_PYTHON_RUFF_FORMAT=true FIX_SHELL_SHFMT=true FIX_SPELL_CODESPELL=true diff --git a/tasks/lint/renovate-deps.py b/tasks/lint/renovate-deps.py index cf63d75..6d69bb4 100755 --- a/tasks/lint/renovate-deps.py +++ b/tasks/lint/renovate-deps.py @@ -133,8 +133,7 @@ def is_true(var): file=sys.stderr, ) print( - "\n💡 Try `mise run fix` to auto-fix lint issues," # fmt: skip - " then re-run `mise run lint` to verify.", + "\n💡 Try `mise run fix` to auto-fix lint issues, then re-run `mise run lint` to verify.", file=sys.stderr, ) sys.exit(1) @@ -169,8 +168,7 @@ def normalize(d): file=sys.stderr, ) print( - "\n💡 Try `mise run fix` to auto-fix lint issues," # fmt: skip - " then re-run `mise run lint` to verify.", + "\n💡 Try `mise run fix` to auto-fix lint issues, then re-run `mise run lint` to verify.", file=sys.stderr, ) sys.exit(1) From 7d2ee562b6bbb86cf8b3cf81ae7392f551cfa556 Mon Sep 17 00:00:00 2001 From: Gregor Zeitlinger Date: Thu, 5 Mar 2026 16:31:51 +0000 Subject: [PATCH 6/6] fix: sort env keys alphabetically Signed-off-by: Gregor Zeitlinger --- .github/config/super-linter.env | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/config/super-linter.env b/.github/config/super-linter.env index d04b1f4..e9558bc 100644 --- a/.github/config/super-linter.env +++ b/.github/config/super-linter.env @@ -10,8 +10,8 @@ VALIDATE_JSCPD=false VALIDATE_JSON_PRETTIER=false # Use Ruff instead of Black/Pylint/isort for Python VALIDATE_PYTHON_BLACK=false -VALIDATE_PYTHON_PYLINT=false VALIDATE_PYTHON_ISORT=false +VALIDATE_PYTHON_PYLINT=false # Enable auto-fix for relevant linters FIX_BIOME_FORMAT=true