misc: add black files/notes (#51575)
This commit is contained in:
parent
5b9bc1ff57
commit
fe28a7938c
|
@ -0,0 +1 @@
|
|||
5b9bc1ff57cfb47458d629c15bcae28ae0bc141b
|
|
@ -0,0 +1,8 @@
|
|||
# See https://pre-commit.com for more information
|
||||
# See https://pre-commit.com/hooks.html for more hooks
|
||||
repos:
|
||||
- repo: https://github.com/psf/black
|
||||
rev: 20.8b1
|
||||
hooks:
|
||||
- id: black
|
||||
args: ['--target-version', 'py37', '--skip-string-normalization', '--line-length', '110']
|
10
README
10
README
|
@ -318,6 +318,16 @@ Unit tests are written using pytest and launched using tox, and can be run with:
|
|||
|
||||
tox
|
||||
|
||||
Code Style
|
||||
----------
|
||||
|
||||
black is used to format the code, using thoses parameters:
|
||||
|
||||
black --target-version py37 --skip-string-normalization --line-length 110
|
||||
|
||||
There is .pre-commit-config.yaml to use pre-commit to automatically run black
|
||||
before commits. (execute `pre-commit install` to install the git hook.)
|
||||
|
||||
Remarks
|
||||
=======
|
||||
|
||||
|
|
8
tox.ini
8
tox.ini
|
@ -1,5 +1,5 @@
|
|||
[tox]
|
||||
envlist = coverage-py2-dj111-{pg,sqlite},coverage-py3-dj{111,22}-{pg,sqlite}
|
||||
envlist = black,coverage-py2-dj111-{pg,sqlite},coverage-py3-dj{111,22}-{pg,sqlite}
|
||||
toxworkdir = {env:TMPDIR:/tmp}/tox-{env:USER}/django-mellon/
|
||||
|
||||
[testenv]
|
||||
|
@ -59,6 +59,12 @@ commands =
|
|||
./getlasso3.sh
|
||||
django-admin {posargs:--help}
|
||||
|
||||
[testenv:black]
|
||||
skip_install = true
|
||||
deps =
|
||||
pre-commit
|
||||
commands =
|
||||
pre-commit run black --all-files --show-diff-on-failure
|
||||
|
||||
[pytest]
|
||||
junit_family=legacy
|
||||
|
|
Loading…
Reference in New Issue