Merge pull request #9 from PuckiSilver/master #417
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 and Format | |
on: | |
push: | |
branches: | |
- master | |
workflow_dispatch: | |
permissions: | |
contents: write | |
concurrency: | |
group: build-and-test | |
cancel-in-progress: true | |
jobs: | |
format: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3.5.2 | |
- name: Setup Python | |
uses: actions/setup-python@v4.6.0 | |
with: | |
python-version: 3.11.x | |
cache: pip | |
architecture: x64 | |
check-latest: true | |
- name: Install black | |
run: | | |
pip install ruff | |
- name: Run black | |
run: | | |
ruff format . --target-version py39 | |
- uses: stefanzweifel/git-auto-commit-action@v4.16.0 | |
with: | |
commit_message: "Apply formatting" | |
lint: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3.5.2 | |
- name: Setup Python | |
uses: actions/setup-python@v4.6.0 | |
with: | |
python-version: 3.11.x | |
cache: pip | |
architecture: x64 | |
check-latest: true | |
- name: Install ruff | |
run: | | |
pip install ruff | |
- name: Run ruff | |
run: | | |
ruff . --fix | |
- uses: stefanzweifel/git-auto-commit-action@v4.16.0 | |
with: | |
commit_message: "Apply linting" | |
bandit: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3.5.2 | |
- name: Setup Python | |
uses: actions/setup-python@v4.6.0 | |
with: | |
python-version: 3.11.x | |
cache: pip | |
architecture: x64 | |
check-latest: true | |
- name: Install bandit | |
run: | | |
pip install bandit | |
- name: Run bandit | |
run: | | |
bandit . -r -s B105,B311 |