diff options
author | Aleš Mrázek <ales.mrazek@nic.cz> | 2024-10-09 22:15:14 +0200 |
---|---|---|
committer | Aleš Mrázek <ales.mrazek@nic.cz> | 2024-10-17 14:39:47 +0200 |
commit | 9bfbee3103941adcf8bc06c57c2e1429f82ce4b2 (patch) | |
tree | 4822f10334e23dae5668d39989d555cad523e33c /scripts/poe-tasks | |
parent | pyproject.toml: ruff linter and code formatter added (diff) | |
download | knot-resolver-9bfbee3103941adcf8bc06c57c2e1429f82ce4b2.tar.xz knot-resolver-9bfbee3103941adcf8bc06c57c2e1429f82ce4b2.zip |
scripts/poe-tasks: use ruff instead of black, isort, pylint and flake8
Diffstat (limited to 'scripts/poe-tasks')
-rwxr-xr-x | scripts/poe-tasks/check | 26 | ||||
-rwxr-xr-x | scripts/poe-tasks/format | 10 |
2 files changed, 15 insertions, 21 deletions
diff --git a/scripts/poe-tasks/check b/scripts/poe-tasks/check index 8cae7fdc..248890b7 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 4b7f39a2..61f73818 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 |