style: apply black formatting #34
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: Lint Python | |
on: | |
push: | |
paths: | |
- "**/*.py" | |
pull_request: | |
paths: | |
- "**/*.py" | |
jobs: | |
black: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: "3.10" | |
- name: Install Poetry | |
run: | | |
curl -sSL https://install.python-poetry.org | python3 - | |
echo 'export PATH="$HOME/.local/bin:$PATH"' >> $GITHUB_ENV | |
- name: Install dependencies | |
run: poetry install | |
- name: Run Black check | |
run: poetry run black --check . | |
- name: Black report | |
if: failure() | |
run: echo "Python files are not formatted correctly." |