tools: skip linter checks if linters are not installed

This commit is contained in:
Yaroslav Chvanov
2023-03-04 03:34:59 +03:00
parent 4b8ac177d1
commit a3f0ea9a52
4 changed files with 20 additions and 0 deletions

View File

@@ -13,4 +13,9 @@ if [ -z "$files" ]; then
exit 77
fi
command -v black >/dev/null 2>&1 || {
echo >&2 "black is not installed"
exit 77
}
black --check $files

View File

@@ -13,4 +13,9 @@ if [ -z "$files" ]; then
exit 77
fi
command -v ruff >/dev/null 2>&1 || {
echo >&2 "ruff is not installed"
exit 77
}
ruff check $files

View File

@@ -13,4 +13,9 @@ if [ -z "$files" ]; then
exit 77
fi
command -v black >/dev/null 2>&1 || {
echo >&2 "black is not installed"
exit 77
}
black $files

View File

@@ -13,4 +13,9 @@ if [ -z "$files" ]; then
exit 77
fi
command -v ruff >/dev/null 2>&1 || {
echo >&2 "ruff is not installed"
exit 77
}
ruff check --fix $files