summaryrefslogtreecommitdiffstats
path: root/scripts/poe-tasks/check
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/poe-tasks/check')
-rwxr-xr-xscripts/poe-tasks/check50
1 files changed, 3 insertions, 47 deletions
diff --git a/scripts/poe-tasks/check b/scripts/poe-tasks/check
index 248890b7..76da1209 100755
--- a/scripts/poe-tasks/check
+++ b/scripts/poe-tasks/check
@@ -4,16 +4,6 @@
src_dir="$(dirname "$(realpath "$0")")"
source $src_dir/utils/_env.sh
-aggregate_rv=0
-function check_rv {
- if test "$1" -eq 0; then
- echo -e " ${green}OK${reset}"
- else
- echo -e " ${red}FAIL${reset}"
- fi
- aggregate_rv=$(( $aggregate_rv + $1 ))
-}
-
# stop failing early, because we wouldn't do anything else than fail
set +e
@@ -24,36 +14,12 @@ check_rv $?
echo
# early exit when dependencies are not installed
-if test "$aggregate_rv" -ne "0"; then
+if test "$aggregated_rv" -ne "0"; then
echo -e "${red}Dependencies are not properly installed. Run this command to fix it:${reset}"
echo -e " ${red}poetry install${reset}"
exit 1
fi
-# check format using ruff
-echo -e "${yellow}Code format checking using ruff...${reset}"
-ruff format --check --diff python/knot_resolver tests/manager scripts/poe-tasks/utils/create_setup.py
-check_rv $?
-echo
-
-# check imports using ruff
-echo -e "${yellow}Imports format checking using ruff...${reset}"
-ruff check --select I python/knot_resolver tests/manager scripts/poe-tasks/utils/create_setup.py
-check_rv $?
-echo
-
-# check code with ruff
-echo -e "${yellow}Code linting using ruff...${reset}"
-ruff check python/knot_resolver tests/pytests
-check_rv $?
-echo
-
-# check types using mypy
-echo -e "${yellow}Type checking using mypy...${reset}"
-mypy python/knot_resolver
-check_rv $?
-echo
-
# check that setup.py is not behind pyproject.toml
echo -e "${yellow}Checking setup.py${reset}"
python scripts/poe-tasks/utils/create_setup.py | diff - setup.py
@@ -76,17 +42,7 @@ check_rv $?
echo
# fancy messages at the end :)
-if test "$aggregate_rv" -eq "0"; then
- echo -e "${green}Everything looks great!${reset}"
-else
- echo -e "${red}Failure.${reset}"
- echo -e "${red}These commands might help you:${reset}"
- echo -e "${red}\tpoe format${reset}"
- echo -e "${red}\tpoe gen-setuppy${reset}"
- echo -e "${red}\tpoe gen-constantspy${reset}"
- echo -e "${red}\tpoe doc-schema${reset}"
- echo -e "${red}That's not great. Could you please fix that?${reset} 😲😟"
-fi
+fancy_message
# exit with the aggregate return value
-exit $aggregate_rv
+exit $aggregated_rv