more changes again 2 #4
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: Check formatting | ||
on: | ||
workfow_call: | ||
inputs: | ||
python_v: | ||
description: "Python version needed to run the code, eg. 3.10.6" | ||
default: 3.10.6 | ||
required: false | ||
type: string | ||
jobs: | ||
format: | ||
runs-on: ubuntu-20.04 | ||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis | ||
- name: Set up Python ${{ inputs.python_v }} | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: ${{ inputs.python_v }} | ||
- name: Install pre-commit | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install pre-commit | ||
pre-commit install | ||
- name: Run pre-commit (all files) | ||
run: | | ||
if test -f ".pre-commit-config.yaml" | ||
then | ||
pre-commit run --all-files --show-diff-on-failure | ||
else | ||
echo "::warning::No pre-commit config available" | ||
fi |