2022-10-29 23:19:09 +08:00
|
|
|
---
|
|
|
|
repos:
|
|
|
|
- repo: https://github.com/pre-commit/pre-commit-hooks
|
2022-12-03 22:06:01 +08:00
|
|
|
rev: v4.4.0
|
2022-10-29 23:19:09 +08:00
|
|
|
hooks:
|
|
|
|
- id: trailing-whitespace
|
|
|
|
- id: end-of-file-fixer
|
2022-11-01 23:24:13 +08:00
|
|
|
- id: check-merge-conflict
|
2022-10-29 23:19:09 +08:00
|
|
|
- id: check-json
|
|
|
|
- id: check-yaml
|
|
|
|
- id: debug-statements
|
|
|
|
- id: requirements-txt-fixer
|
2022-11-01 23:24:13 +08:00
|
|
|
- id: check-added-large-files
|
|
|
|
- id: check-byte-order-marker
|
2022-10-29 23:19:09 +08:00
|
|
|
- id: fix-encoding-pragma
|
|
|
|
args: [--remove]
|
|
|
|
- id: pretty-format-json
|
|
|
|
args: [--autofix, --indent, '4', --no-sort-keys]
|
2022-11-01 23:24:13 +08:00
|
|
|
- repo: https://github.com/pre-commit/mirrors-autopep8
|
2023-03-07 08:19:54 +08:00
|
|
|
rev: v2.0.2
|
2022-11-01 23:24:13 +08:00
|
|
|
hooks:
|
|
|
|
- id: autopep8
|
2022-10-29 23:19:09 +08:00
|
|
|
- repo: https://github.com/adrienverge/yamllint.git
|
2023-05-23 08:31:36 +08:00
|
|
|
rev: v1.32.0 # or higher tag
|
2022-10-29 23:19:09 +08:00
|
|
|
hooks:
|
|
|
|
- id: yamllint
|
|
|
|
args: [--format, parsable, --strict]
|
|
|
|
exclude: ^.github/
|
|
|
|
- repo: https://github.com/lyz-code/yamlfix
|
2023-06-20 09:39:40 +08:00
|
|
|
rev: 1.11.0
|
2022-10-29 23:19:09 +08:00
|
|
|
hooks:
|
|
|
|
- id: yamlfix
|
|
|
|
exclude: ^.github/
|
2023-05-09 09:12:14 +08:00
|
|
|
- repo: https://github.com/asottile/reorder-python-imports
|
2023-06-20 09:39:40 +08:00
|
|
|
rev: v3.10.0
|
2022-10-29 23:19:09 +08:00
|
|
|
hooks:
|
|
|
|
- id: reorder-python-imports
|
2022-11-01 23:32:02 +08:00
|
|
|
- repo: https://github.com/asottile/pyupgrade
|
2023-06-20 09:39:40 +08:00
|
|
|
rev: v3.7.0
|
2022-11-01 23:32:02 +08:00
|
|
|
hooks:
|
|
|
|
- id: pyupgrade
|
|
|
|
args: [--py3-plus]
|
2022-10-29 23:19:09 +08:00
|
|
|
- repo: https://github.com/psf/black
|
2023-04-04 10:03:13 +08:00
|
|
|
rev: 23.3.0
|
2022-10-29 23:19:09 +08:00
|
|
|
hooks:
|
|
|
|
- id: black
|
|
|
|
language_version: python3
|
2023-06-12 03:54:52 +08:00
|
|
|
args: [--line-length, '130', --preview]
|
2022-11-08 05:03:18 +08:00
|
|
|
- repo: https://github.com/PyCQA/flake8
|
2022-12-03 22:06:01 +08:00
|
|
|
rev: 6.0.0
|
2022-10-29 23:19:09 +08:00
|
|
|
hooks:
|
|
|
|
- id: flake8
|
|
|
|
args: [--config=.flake8]
|
2023-06-05 02:57:29 +08:00
|
|
|
- repo: local
|
|
|
|
hooks:
|
|
|
|
- id: increase-version
|
|
|
|
name: Increase version if branch contains "develop"
|
|
|
|
entry: ./scripts/pre-commit/increase_version.sh
|
|
|
|
language: script
|
|
|
|
pass_filenames: false
|
|
|
|
stages: [commit]
|