rwx/sh/lint/ruff.sh

29 lines
387 B
Bash
Raw Permalink Normal View History

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