refactor(history): commit development branch
All checks were successful
/ job (push) Successful in 1m12s
All checks were successful
/ job (push) Successful in 1m12s
new development branch from root commit
This commit is contained in:
parent
3e562930f6
commit
020aaa0b9a
94 changed files with 4804 additions and 0 deletions
78
sh/lint/lint.sh
Normal file
78
sh/lint/lint.sh
Normal file
|
@ -0,0 +1,78 @@
|
|||
# lint code
|
||||
rwx_lint() {
|
||||
local path="${1}"
|
||||
[ -n "${path}" ] || return 1
|
||||
rwx_lint_clean "${path}"
|
||||
rwx_lint_tasks "${path}"
|
||||
set \
|
||||
"python" \
|
||||
"shell"
|
||||
local code
|
||||
for code in "${@}"; do
|
||||
rwx_log "" "${code}"
|
||||
"rwx_lint_${code}" "${path}"
|
||||
done
|
||||
rwx_lint_clean "${path}"
|
||||
}
|
||||
|
||||
# clean
|
||||
rwx_lint_clean() {
|
||||
local path="${1}"
|
||||
[ -n "${path}" ] || return 1
|
||||
rwx_log "" "clean" ""
|
||||
py3clean "${path}"
|
||||
set \
|
||||
"mypy" \
|
||||
"ruff"
|
||||
local tool
|
||||
for tool in "${@}"; do
|
||||
rwx_remove "${path}/.${tool}_cache"
|
||||
done
|
||||
}
|
||||
|
||||
# lint python code
|
||||
rwx_lint_python() {
|
||||
local path="${1}"
|
||||
local action
|
||||
set \
|
||||
"pylint" \
|
||||
"pydoclint" \
|
||||
"mypy" \
|
||||
"ruff"
|
||||
for action in "${@}"; do
|
||||
rwx_log "" "${action}"
|
||||
"rwx_${action}" "${path}"
|
||||
done
|
||||
}
|
||||
|
||||
# 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
|
||||
}
|
||||
|
||||
# lint code tasks
|
||||
rwx_lint_tasks() {
|
||||
local path="${1}"
|
||||
local type
|
||||
set \
|
||||
"LATER" \
|
||||
"TODO" \
|
||||
"FIXME"
|
||||
for type in "${@}"; do
|
||||
rwx_log "" "${type}"
|
||||
grep \
|
||||
--after "1" \
|
||||
--directories "recurse" \
|
||||
--line-number \
|
||||
" ${type}" \
|
||||
"${path}"
|
||||
done
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue