diff --git a/.git-blame-ignore-revs b/.git-blame-ignore-revs new file mode 100644 index 0000000..fd3b8e2 --- /dev/null +++ b/.git-blame-ignore-revs @@ -0,0 +1,2 @@ +# codestyle: add black, isort, pyupgrade (#61513) +6006c9655793c895ce896c18770620e79a315038 diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 0000000..225214f --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,18 @@ +# 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: 21.10b0 + hooks: + - id: black + args: ['--target-version', 'py37', '--skip-string-normalization', '--line-length', '110'] +- repo: https://github.com/PyCQA/isort + rev: 5.7.0 + hooks: + - id: isort + args: ['--profile', 'black', '--line-length', '110'] +- repo: https://github.com/asottile/pyupgrade + rev: v2.20.0 + hooks: + - id: pyupgrade + args: ['--keep-percent-format', '--py37-plus'] diff --git a/README b/README index 03f586e..bebc35f 100644 --- a/README +++ b/README @@ -8,6 +8,28 @@ Installation Install with `pip install authentic2-cut` +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.) + +isort is used to format the imports, using those parameter: + + isort --profile black --line-length 110 + +pyupgrade is used to automatically upgrade syntax, using those parameters: + + pyupgrade --keep-percent-format --py37-plus + +There is .pre-commit-config.yaml to use pre-commit to automatically run black, +isort and pyupgrade before commits. (execute `pre-commit install` to install +the git hook.) + Settings ========