Merge pull request #84 from NERDSITU/83-version-100-release #371
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 | |
on: | |
push: | |
paths: | |
- 'superblockify/**.py' | |
- 'tests/**.py' | |
jobs: | |
run-black: | |
name: Run Black codestyle | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out Git repository | |
uses: actions/checkout@v4 | |
with: | |
ref: ${{ github.head_ref }} | |
- name: Run Black | |
uses: psf/black@stable | |
with: | |
src: './superblockify ./tests ./scripts' | |
- uses: stefanzweifel/git-auto-commit-action@v4 | |
with: | |
commit_message: Fix code style issues with Black | |
commit_user_name: ${{ github.actor }} | |
commit_user_email: ${{ github.actor }}@users.noreply.github.com | |
run-pylint: | |
strategy: | |
matrix: | |
python-version: ["3.12"] | |
os: [ubuntu-latest] | |
name: Run Pylint code analyzer | |
needs: run-black | |
runs-on: ${{ matrix.os }} | |
steps: | |
- name: Check out Git repository | |
uses: actions/checkout@v4 | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install pylint | |
run: pip install pylint | |
- name: Lint Source Code | |
run: pylint -d E0401 superblockify/ | |
# ignore import-errors first, analyze later with tests in anaconda environment | |
- name: Lint Tests | |
run: pylint -d E0401 -d R0801 tests/ | |
# also ignore code repetition in tests |