misc: add black (#58937)

This commit is contained in:
Serghei Mihai 2021-11-24 12:37:59 +01:00
parent 3ee72e5336
commit 766991930a
3 changed files with 16 additions and 1 deletions

View File

@ -1,2 +1,4 @@
# trivial: apply pyupgrade (#58937)
caa40e7e771b41bd1d164341a2e7f40689cbe4ba
# trivial: apply black (#58937)
3ee72e5336d03526c7ab297a5cf09057a6d5d1c2

View File

@ -1,8 +1,13 @@
# 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']
- repo: https://github.com/asottile/pyupgrade
rev: v2.20.0
hooks:
- id: pyupgrade
args: ['--keep-percent-format', '--py37-plus']
args: ['--keep-percent-format', '--py37-plus']

View File

@ -183,6 +183,14 @@ You can put some configuration in ~/.config/eopayment.init ::
Code Style
==========
black is used to format the code, using thoses parameters:
black --target-version py35 --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.)
pyupgrade is used to automatically upgrade syntax, using those parameters:
pyupgrade --keep-percent-format --py37-plus