2021-10-28 18:35:01 +02:00
|
|
|
# Define hooks for code formations
|
|
|
|
# Will be applied on any updated commit files if a user has installed and linked commit hook
|
|
|
|
|
|
|
|
default_language_version:
|
|
|
|
python: python3.8
|
|
|
|
|
|
|
|
# Define bot property if installed via https://github.com/marketplace/pre-commit-ci
|
|
|
|
ci:
|
|
|
|
autofix_prs: true
|
|
|
|
autoupdate_commit_msg: '[pre-commit.ci] pre-commit suggestions'
|
2022-04-22 13:43:50 -07:00
|
|
|
autoupdate_schedule: monthly
|
2021-10-28 18:35:01 +02:00
|
|
|
# submodules: true
|
|
|
|
|
|
|
|
repos:
|
|
|
|
- repo: https://github.com/pre-commit/pre-commit-hooks
|
2022-07-04 22:09:24 +02:00
|
|
|
rev: v4.3.0
|
2021-10-28 18:35:01 +02:00
|
|
|
hooks:
|
2022-08-01 02:09:36 +02:00
|
|
|
# - id: end-of-file-fixer
|
2021-10-28 18:35:01 +02:00
|
|
|
- id: trailing-whitespace
|
|
|
|
- id: check-case-conflict
|
|
|
|
- id: check-yaml
|
|
|
|
- id: check-toml
|
|
|
|
- id: pretty-format-json
|
|
|
|
- id: check-docstring-first
|
|
|
|
|
|
|
|
- repo: https://github.com/asottile/pyupgrade
|
2022-08-01 21:48:59 +02:00
|
|
|
rev: v2.37.3
|
2021-10-28 18:35:01 +02:00
|
|
|
hooks:
|
|
|
|
- id: pyupgrade
|
|
|
|
name: Upgrade code
|
2022-04-22 13:43:50 -07:00
|
|
|
args: [ --py37-plus ]
|
2021-10-28 18:35:01 +02:00
|
|
|
|
2021-11-04 17:24:25 +01:00
|
|
|
- repo: https://github.com/PyCQA/isort
|
2022-01-03 10:42:50 -08:00
|
|
|
rev: 5.10.1
|
2021-11-04 17:24:25 +01:00
|
|
|
hooks:
|
|
|
|
- id: isort
|
|
|
|
name: Sort imports
|
2021-10-28 18:35:01 +02:00
|
|
|
|
2022-03-31 23:52:34 +09:00
|
|
|
- repo: https://github.com/pre-commit/mirrors-yapf
|
2022-04-04 22:47:00 +02:00
|
|
|
rev: v0.32.0
|
2022-03-31 23:52:34 +09:00
|
|
|
hooks:
|
|
|
|
- id: yapf
|
2022-03-31 17:26:34 +02:00
|
|
|
name: YAPF formatting
|
2021-10-28 18:35:01 +02:00
|
|
|
|
2022-04-23 04:36:27 +08:00
|
|
|
- repo: https://github.com/executablebooks/mdformat
|
|
|
|
rev: 0.7.14
|
|
|
|
hooks:
|
|
|
|
- id: mdformat
|
2022-04-22 13:43:50 -07:00
|
|
|
name: MD formatting
|
2022-04-23 04:36:27 +08:00
|
|
|
additional_dependencies:
|
|
|
|
- mdformat-gfm
|
|
|
|
- mdformat-black
|
2022-06-26 17:46:39 +02:00
|
|
|
exclude: "README.md|README_cn.md"
|
2021-10-28 18:35:01 +02:00
|
|
|
|
2022-04-21 09:44:52 +08:00
|
|
|
- repo: https://github.com/asottile/yesqa
|
|
|
|
rev: v1.3.0
|
|
|
|
hooks:
|
|
|
|
- id: yesqa
|
2021-10-28 18:35:01 +02:00
|
|
|
|
|
|
|
- repo: https://github.com/PyCQA/flake8
|
2022-08-01 21:48:59 +02:00
|
|
|
rev: 5.0.2
|
2021-10-28 18:35:01 +02:00
|
|
|
hooks:
|
|
|
|
- id: flake8
|
|
|
|
name: PEP8
|