mirror of
https://github.com/cookiecutter/cookiecutter-django.git
synced 2025-02-16 19:41:03 +03:00
Run pre-commit for linting in Docker
This commit is contained in:
parent
c7bb4834e0
commit
e08b17a234
|
@ -8,6 +8,7 @@ black==20.8b1
|
|||
isort==5.8.0
|
||||
flake8==3.9.0
|
||||
flake8-isort==4.0.0
|
||||
pre-commit==2.10.1
|
||||
|
||||
# Testing
|
||||
# ------------------------------------------------------------------------------
|
||||
|
|
|
@ -28,6 +28,7 @@ sudo utility/install_os_dependencies.sh install
|
|||
pip install -r requirements/local.txt
|
||||
|
||||
# Lint by running pre-commit on all files
|
||||
# Needs a git repo to find the project root
|
||||
git init
|
||||
git add .
|
||||
pre-commit run --show-diff-on-failure -a
|
||||
|
|
|
@ -17,12 +17,16 @@ cd .cache/docker
|
|||
cookiecutter ../../ --no-input --overwrite-if-exists use_docker=y $@
|
||||
cd my_awesome_project
|
||||
|
||||
# Lint by running pre-commit on all files
|
||||
# Needs a git repo to find the project root
|
||||
# We don't have git inside Docker, so run it outside
|
||||
git init
|
||||
git add .
|
||||
pre-commit run --show-diff-on-failure -a
|
||||
|
||||
# run the project's type checks
|
||||
docker-compose -f local.yml run django mypy my_awesome_project
|
||||
|
||||
# Run black with --check option
|
||||
docker-compose -f local.yml run django black --check --diff --exclude 'migrations' ./
|
||||
|
||||
# run the project's tests
|
||||
docker-compose -f local.yml run django pytest
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user