rwx/sh/lint/ruff.sh

27 lines
355 B
Bash
Raw Normal View History

2025-01-31 18:42:58 +01:00
rwx_ruff() {
local path="${1}"
2025-01-31 23:03:03 +01:00
local action
set \
"check" \
"format"
for action in "${@}"; do
"rwx_ruff_${action}" "${path}"
done
}
rwx_ruff_check() {
local path="${1}"
ruff check \
--select "ALL" \
--ignore "D203,D213" \
2025-01-31 18:42:58 +01:00
"${path}"
}
rwx_ruff_format() {
local path="${1}"
ruff format \
--diff \
--line-length 80 \
"${path}"
}