CI: Add python formatting to pre-commit and make all files comply #491
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: pre-commit | |
on: [push, pull_request] | |
jobs: | |
pre-commit: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: cvmfs-contrib/github-action-cvmfs@v4 | |
- uses: aidasoft/run-lcg-view@v4 | |
with: | |
container: el9 | |
view-path: /cvmfs/sw-nightlies.hsf.org/key4hep | |
run: | | |
python -m venv /root/pre-commit-venv | |
source /root/pre-commit-venv/bin/activate | |
pip install pre-commit | |
export PYTHONPATH=$VIRTUAL_ENV/lib/python3.$(python3 -c 'import sys; print(f"{sys.version_info[1]}")')/site-packages:$PYTHONPATH | |
pre-commit run --show-diff-on-failure \ | |
--color=always \ | |
--all-files |