Added isort in github action #11
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: Auto Linting and Formatting | |
on: | |
push: | |
branches: | |
- master | |
jobs: | |
linting: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: '3.x' | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install ruff | |
pip install isort | |
- name: Lint with ruff | |
run: ruff check --fix *.py | |
- name: Format with ruff | |
run: ruff format *.py | |
- name: isort packages for python files | |
run: isort models.py otypes.py utils.py mailing.py mailing_templates.py | |
- name: Remove ruff cache | |
run: rm -rf .ruff_cache | |
- uses: stefanzweifel/git-auto-commit-action@v5 | |
with: | |
commit_message: Apply Linting & Formatting Fixes | |
# - name: Remove Linting Branch | |
# run: | | |
# if git rev-parse --verify linting >/dev/null 2>&1; then | |
# git push origin --delete linting | |
# fi | |