Add ruff linter to pre-commit

This commit is contained in:
expelledboy 2024-03-23 12:26:52 +02:00
parent 7c5c0a41d7
commit 021ca2a7fa
No known key found for this signature in database
GPG Key ID: C7349812E65CD854
2 changed files with 5 additions and 2 deletions

3
.github/hooks/pre-commit vendored Executable file
View File

@ -0,0 +1,3 @@
#!/usr/bin/env bash
ruff check ./

View File

@ -25,7 +25,7 @@
setuptools setuptools
wheel wheel
venvShellHook venvShellHook
pylint pkgs.ruff
]); ]);
# python setup # python setup
@ -35,11 +35,11 @@
unset SOURCE_DATE_EPOCH unset SOURCE_DATE_EPOCH
''; '';
postShellHook = '' postShellHook = ''
# python setup
unset SOURCE_DATE_EPOCH unset SOURCE_DATE_EPOCH
unset LD_PRELOAD unset LD_PRELOAD
PYTHONPATH=$PWD/$venvDir/${python.sitePackages}:$PYTHONPATH PYTHONPATH=$PWD/$venvDir/${python.sitePackages}:$PYTHONPATH
pip install --require-virtualenv -r requirements.txt | grep -v 'already satisfied' pip install --require-virtualenv -r requirements.txt | grep -v 'already satisfied'
git config --local core.hooksPath .github/hooks
''; '';
}; };