build: add Ruff for Python code linting

This commit is contained in:
Yaroslav Chvanov
2023-03-01 17:08:53 +03:00
parent 49146638a6
commit 3aa82d2b35
5 changed files with 59 additions and 1 deletions

10
tools/python-ruff.sh Executable file
View File

@@ -0,0 +1,10 @@
#!/bin/sh
if [ -z "$MESON_SOURCE_ROOT" ]; then
echo "Expected \$MESON_SOURCE_ROOT to be set. Are you sure you are running this through ninja?"
exit 100
fi
cd "$MESON_SOURCE_ROOT" || exit 101
ruff check --fix $(git ls-files "*.py" "*.py.in")