| 1 | #!/usr/bin/env bash |
| 2 | |
| 3 | # ensure consistent behaviour |
| 4 | src_dir="$(dirname "$(realpath "$0")")" |
| 5 | source $src_dir/utils/_env.sh |
| 6 | |
| 7 | dirs="python/knot_resolver/ tests/manager scripts/poe-tasks/utils/create_setup.py" |
| 8 | |
| 9 | # sort python import |
| 10 | echo -e "${yellow}Sorting Python imports using ruff...${reset}" |
| 11 | ruff check --select I --fix $dirs |
| 12 | check_rv $? |
| 13 | echo |
| 14 | |
| 15 | # format python code |
| 16 | echo -e "${yellow}Formatting Python code using ruff...${reset}" |
| 17 | ruff format $dirs |
| 18 | check_rv $? |
| 19 | echo |
| 20 | |
| 21 | # fancy messages at the end :) |
| 22 | fancy_message |
| 23 | |
| 24 | # exit with the aggregate return value |
| 25 | exit $aggregated_rv |