rwx/sh/lint/lint.sh

41 lines
571 B
Bash
Raw Normal View History

2025-01-31 23:37:33 +01:00
# lint code
rwx_lint() {
local path="${1}"
local code
set \
"python" \
"shell"
for code in "${@}"; do
rwx_log "${code}"
"rwx_lint_${code}" "${path}"
done
}
2025-01-31 18:31:24 +01:00
# lint python code
2025-01-31 23:34:44 +01:00
rwx_lint_python() {
2025-01-31 18:31:24 +01:00
local path="${1}"
2025-01-31 23:31:44 +01:00
local action
set \
"pylint" \
"pydoclint" \
"mypy" \
"ruff"
for action in "${@}"; do
rwx_log "${action}"
"rwx_${action}" "${path}"
done
2025-01-31 18:31:24 +01:00
}
2025-01-31 23:34:44 +01:00
# lint shell code
rwx_lint_shell() {
local path="${1}"
local action
set \
"shellcheck" \
"shfmt"
for action in "${@}"; do
rwx_log "${action}"
"rwx_${action}" "${path}"
done
}