# force all unspecified python hooks to run python3
python: python3
repos:
-- repo: https://github.com/pre-commit/pre-commit-hooks
- rev: v4.2.0
- hooks:
- - id: check-executables-have-shebangs
- - id: check-merge-conflict
- - id: check-yaml
- - id: end-of-file-fixer
- exclude: (.*\.mbox)|(.*\.css)|(.*\.json)|(.*\.js)|(.*\.svg)|(.*/mails/.*-subject\.txt)
- - id: trailing-whitespace
- exclude: (.*\.mbox)|(.*\.svg)
-- repo: https://gitlab.com/pycqa/flake8
- rev: 3.9.2
- hooks:
- - id: flake8
-- repo: https://github.com/Lucas-C/pre-commit-hooks
- rev: v1.1.13
- hooks:
- - id: remove-tabs
- exclude: (.*\.mbox)|(.*\.svg)|(.*\.sql)|(.*\.conf)
- - id: remove-crlf
- exclude: (.*\.mbox)|(.*\.svg)
+ - repo: https://github.com/pre-commit/pre-commit-hooks
+ rev: v4.2.0
+ hooks:
+ - id: check-executables-have-shebangs
+ - id: check-merge-conflict
+ - id: check-yaml
+ - id: end-of-file-fixer
+ exclude: (.*\.mbox)|(.*\.css)|(.*\.json)|(.*\.js)|(.*\.svg)|(.*/mails/.*-subject\.txt)
+ - id: trailing-whitespace
+ exclude: (.*\.mbox)|(.*\.svg)
+ - repo: https://gitlab.com/pycqa/flake8
+ rev: 3.9.2
+ hooks:
+ - id: flake8
+ - repo: https://github.com/psf/black
+ rev: 22.3.0
+ hooks:
+ - id: black
+ - repo: https://github.com/Lucas-C/pre-commit-hooks
+ rev: v1.1.13
+ hooks:
+ - id: remove-tabs
+ exclude: (.*\.mbox)|(.*\.svg)|(.*\.sql)|(.*\.conf)
+ - id: remove-crlf
+ exclude: (.*\.mbox)|(.*\.svg)
-name \*.sh -print | xargs bashate -i E006"
[testenv:pep8]
-deps = flake8
-commands = flake8 {posargs:patchwork manage.py}
+deps =
+ black
+ flake8
+commands =
+ black --check --quiet {posargs:patchwork manage.py}
+ flake8 {posargs:patchwork manage.py}
[flake8]
# Some rules are ignored as their use makes the code more difficult to read: