From: Aleš Mrázek Date: Wed, 9 Oct 2024 20:15:14 +0000 (+0200) Subject: scripts/poe-tasks: use ruff instead of black, isort, pylint and flake8 X-Git-Tag: v6.0.9~5^2~9 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9bfbee3103941adcf8bc06c57c2e1429f82ce4b2;p=thirdparty%2Fknot-resolver.git scripts/poe-tasks: use ruff instead of black, isort, pylint and flake8 --- diff --git a/scripts/poe-tasks/check b/scripts/poe-tasks/check index 8cae7fdc9..248890b76 100755 --- a/scripts/poe-tasks/check +++ b/scripts/poe-tasks/check @@ -30,31 +30,25 @@ if test "$aggregate_rv" -ne "0"; then exit 1 fi -# check formatting using black -echo -e "${yellow}Checking formatting using black...${reset}" -black python/knot_resolver tests/manager scripts/poe-tasks/utils/create_setup.py --check --diff +# 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 formatting using isort -echo -e "${yellow}Checking imports formatting using isort...${reset}" -isort python/knot_resolver tests/manager scripts/poe-tasks/utils/create_setup.py --check --diff +# 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 pylint -echo -e "${yellow}Linting using pylint...${reset}" -pylint python/knot_resolver +# check code with ruff +echo -e "${yellow}Code linting using ruff...${reset}" +ruff check python/knot_resolver tests/pytests check_rv $? echo -# check code with flake8 -echo -e "${yellow}Linting using flake8...${reset}" -flake8 --max-line-length=200 --ignore=E266,W503 --extend-ignore=E203 python/knot_resolver -check_rv $? -echo - -# check types with mypy +# check types using mypy echo -e "${yellow}Type checking using mypy...${reset}" mypy python/knot_resolver check_rv $? diff --git a/scripts/poe-tasks/format b/scripts/poe-tasks/format index 4b7f39a2b..61f738189 100755 --- a/scripts/poe-tasks/format +++ b/scripts/poe-tasks/format @@ -4,10 +4,10 @@ src_dir="$(dirname "$(realpath "$0")")" source $src_dir/utils/_env.sh -dirs="python/knot_resolver/ tests/manager scripts/poe-tasks/utils/create_setup.py build_c_extensions.py" +dirs="python/knot_resolver/ tests/manager scripts/poe-tasks/utils/create_setup.py" -# run black code formater -black $dirs +# sort python import +ruff check --select I --fix $dirs -# sort python imports -isort $dirs +# format python code +ruff format $dirs