Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions .github/config/super-linter.env
Original file line number Diff line number Diff line change
Expand Up @@ -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_ISORT=false
VALIDATE_PYTHON_PYLINT=false

# Enable auto-fix for relevant linters
FIX_BIOME_FORMAT=true
Expand All @@ -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
Expand Down
8 changes: 8 additions & 0 deletions tasks/lint/renovate-deps.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,10 @@ 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())
Expand Down Expand Up @@ -163,6 +167,10 @@ 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)


Expand Down
23 changes: 19 additions & 4 deletions tasks/lint/super-linter.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,21 @@ if [ "${usage_autofix:-}" = "true" ]; then
AUTOFIX=true
fi

_LINTER_RAN=false

_on_exit() {
local ec=$?
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
Comment thread
zeitlinger marked this conversation as resolved.
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."
Expand Down Expand Up @@ -40,14 +55,14 @@ 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

_LINTER_RAN=true
$RUNTIME container run --rm --platform linux/amd64 \
-e RUN_LOCAL=true \
-e DEFAULT_BRANCH=main \
Expand Down