sixfeetup / scaf

scaf provides developers and DevOps engineers with a complete blueprint for a new project using Kubernetes
BSD 3-Clause "New" or "Revised" License
84 stars 13 forks source link

Should include pre-commit with black, isort and django migration check in the output #16

Open gfranxman opened 2 years ago

gfranxman commented 2 years ago

I use:

repos:
-   repo: https://github.com/pre-commit/pre-commit-hooks
    rev: v2.3.0
    hooks:
    -   id: check-yaml
    -   id: end-of-file-fixer
    -   id: trailing-whitespace

-   repo: https://github.com/psf/black
    rev: 22.8.0
    hooks:
    -   id: black

-   repo: https://github.com/pycqa/isort
    rev: 5.6.4
    hooks:
      - id: isort
        args: ["--profile", "black", "--filter-files"]

-   repo: local
    hooks:
      - id: check-django-migrations
        name: Check django migrations
        entry: make check-migrations
        language: system
        types: [python] # hook only runs if a python file is staged
        pass_filenames: false

and in the Makefile:

check-migrations:  ## Check the django app for missing migrations
    @docker-compose exec -i django ./manage.py makemigrations --dry-run --check --no-input
daveoconnor commented 4 months ago

Ruff now has isort support