mirror of
https://github.com/cookiecutter/cookiecutter-django.git
synced 2024-11-10 19:57:09 +03:00
Add pre-commit for the generated project. (#2171)
This commit is contained in:
parent
8681a0c3fb
commit
4a194c6966
|
@ -137,6 +137,7 @@ Listed in alphabetical order.
|
|||
Keyvan Mosharraf `@keyvanm`_
|
||||
Krzysztof Szumny `@noisy`_
|
||||
Krzysztof Żuraw `@krzysztofzuraw`_
|
||||
Leo won `@leollon`_
|
||||
Leo Zhou `@glasslion`_
|
||||
Leonardo Jimenez `@xpostudio4`_
|
||||
Lin Xianyi `@iynaix`_
|
||||
|
@ -291,6 +292,7 @@ Listed in alphabetical order.
|
|||
.. _@keyvanm: https://github.com/keyvanm
|
||||
.. _@knitatoms: https://github.com/knitatoms
|
||||
.. _@krzysztofzuraw: https://github.com/krzysztofzuraw
|
||||
.. _@leollon: https://github.com/leollon
|
||||
.. _@MathijsHoogland: https://github.com/MathijsHoogland
|
||||
.. _@mapx: https://github.com/mapx
|
||||
.. _@mattayes: https://github.com/mattayes
|
||||
|
|
|
@ -53,6 +53,7 @@ Features
|
|||
* Instructions for deploying to PythonAnywhere_
|
||||
* Run tests with unittest or pytest
|
||||
* Customizable PostgreSQL version
|
||||
* Default integration with pre-commit_ for identifying simple issues before submission to code review
|
||||
|
||||
.. _`maintained Foundation fork`: https://github.com/Parbhat/cookiecutter-django-foundation
|
||||
|
||||
|
@ -84,6 +85,7 @@ Optional Integrations
|
|||
.. _PythonAnywhere: https://www.pythonanywhere.com/
|
||||
.. _Traefik: https://traefik.io/
|
||||
.. _LetsEncrypt: https://letsencrypt.org/
|
||||
.. _pre-commit: https://github.com/pre-commit/pre-commit
|
||||
|
||||
Constraints
|
||||
-----------
|
||||
|
|
|
@ -26,6 +26,12 @@ First things first.
|
|||
#. Install development requirements: ::
|
||||
|
||||
$ pip install -r requirements/local.txt
|
||||
$ pre-commit install
|
||||
|
||||
.. note::
|
||||
|
||||
the `pre-commit` exists in the generated project as default.
|
||||
for the details of `pre-commit`, follow the [site of pre-commit](https://pre-commit.com/).
|
||||
|
||||
#. Create a new PostgreSQL database using createdb_: ::
|
||||
|
||||
|
|
19
{{cookiecutter.project_slug}}/.pre-commit-config.yaml
Normal file
19
{{cookiecutter.project_slug}}/.pre-commit-config.yaml
Normal file
|
@ -0,0 +1,19 @@
|
|||
exclude: 'docs|node_modules|migrations|.git|.tox'
|
||||
default_stages: [commit]
|
||||
fail_fast: true
|
||||
|
||||
repos:
|
||||
- repo: https://github.com/pre-commit/pre-commit-hooks
|
||||
rev: master
|
||||
hooks:
|
||||
- id: trailing-whitespace
|
||||
files: (^|/)a/.+\.(py|html|sh|css|js)$
|
||||
|
||||
- repo: local
|
||||
hooks:
|
||||
- id: flake8
|
||||
name: flake8
|
||||
entry: flake8
|
||||
language: python
|
||||
types: [python]
|
||||
|
|
@ -24,6 +24,7 @@ pylint-django==2.0.11 # https://github.com/PyCQA/pylint-django
|
|||
{%- if cookiecutter.use_celery == 'y' %}
|
||||
pylint-celery==0.3 # https://github.com/PyCQA/pylint-celery
|
||||
{%- endif %}
|
||||
pre-commit==1.20.0 # https://github.com/pre-commit/pre-commit
|
||||
|
||||
# Django
|
||||
# ------------------------------------------------------------------------------
|
||||
|
|
Loading…
Reference in New Issue
Block a user