From 766991930adc00cdaea0b6b914710b4f873289f0 Mon Sep 17 00:00:00 2001 From: Serghei Mihai Date: Wed, 24 Nov 2021 12:37:59 +0100 Subject: [PATCH] misc: add black (#58937) --- .git-blame-ignore-revs | 2 ++ .pre-commit-config.yaml | 7 ++++++- README.txt | 8 ++++++++ 3 files changed, 16 insertions(+), 1 deletion(-) diff --git a/.git-blame-ignore-revs b/.git-blame-ignore-revs index 4b73daf..fe9f517 100644 --- a/.git-blame-ignore-revs +++ b/.git-blame-ignore-revs @@ -1,2 +1,4 @@ # trivial: apply pyupgrade (#58937) caa40e7e771b41bd1d164341a2e7f40689cbe4ba +# trivial: apply black (#58937) +3ee72e5336d03526c7ab297a5cf09057a6d5d1c2 diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index dcca49f..354b2d8 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -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'] \ No newline at end of file + args: ['--keep-percent-format', '--py37-plus'] diff --git a/README.txt b/README.txt index 31eacce..67c9e9a 100644 --- a/README.txt +++ b/README.txt @@ -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