Merge pull request #2 from HummingByteDev/develop #15
This file contains hidden or 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: Code Quality | |
| on: | |
| push: | |
| branches: [main, develop] | |
| pull_request: | |
| branches: [main, develop] | |
| jobs: | |
| quality: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.12" | |
| cache: "pip" | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install --upgrade pip setuptools wheel | |
| pip install -e ".[dev]" | |
| # Ensure the package itself is importable (fixes mypy django init) | |
| pip install -e . | |
| - name: Lint with flake8 (warnings only) | |
| continue-on-error: true | |
| run: | | |
| echo "flake8 - critical syntax only (fails job if found)" | |
| flake8 djpaystack --count --select=E9,F63,F7,F82 --show-source --statistics || { echo "Critical flake8 issues found!"; exit 1; } | |
| echo "flake8 - style & warnings (always continue)" | |
| flake8 djpaystack --count --exit-zero --max-complexity=10 --max-line-length=100 --statistics || true | |
| - name: Format check with Black (warnings only) | |
| continue-on-error: true | |
| run: black --check --diff djpaystack || true | |
| - name: Import sort check with isort (warnings only) | |
| continue-on-error: true | |
| run: isort --check-only --diff djpaystack || true | |
| - name: Type check with mypy (warnings only) | |
| continue-on-error: true | |
| run: | | |
| # Use project mypy config but avoid running strict checks on test/dev helpers | |
| mypy djpaystack --ignore-missing-imports --exclude "djpaystack/tests|djpaystack/dev" || true | |
| # (If you want to fail on type errors later, remove `continue-on-error: true` and `|| true`) | |
| - name: Security check with Bandit (warnings only) | |
| continue-on-error: true | |
| run: bandit -r djpaystack -ll -ii || true | |
| # Bonus: Ruff variant (once you migrate – much faster & combines most tools) | |
| # - name: Ruff check (non-blocking) | |
| # continue-on-error: true | |
| # run: ruff check --output-format=github djpaystack || true |