pmbootstrap-meow/.ci/ruff.sh
Oliver Smith 1020bd61ad
CI: ruff: fix "ruff <path>" warning (MR 2274)
Fix for:
warning: `ruff <path>` is deprecated. Use `ruff check <path>` instead.
2024-03-17 13:37:55 +01:00

19 lines
432 B
Bash
Executable file

#!/bin/sh -e
# Description: lint all python scripts
# https://postmarketos.org/pmb-ci
if [ "$(id -u)" = 0 ]; then
set -x
apk -q add ruff
exec su "${TESTUSER:-build}" -c "sh -e $0"
fi
set -x
# __init__.py with additional ignore:
# F401: imported, but not used
# shellcheck disable=SC2046
ruff check --ignore "F401" $(find . -not -path '*/venv/*' -name '__init__.py')
# Check all other files
ruff check --exclude=__init__.py .