2023-08-13 14:02:24 +08:00
|
|
|
default_stages: [ commit ]
|
|
|
|
|
|
2023-07-22 11:57:45 +08:00
|
|
|
# Install
|
|
|
|
|
# 1. pip install pre-commit
|
|
|
|
|
# 2. pre-commit install(the first time you download the repo, it will be cached for future use)
|
|
|
|
|
repos:
|
|
|
|
|
- repo: https://github.com/pycqa/isort
|
|
|
|
|
rev: 5.11.5
|
|
|
|
|
hooks:
|
|
|
|
|
- id: isort
|
|
|
|
|
args: ['--profile', 'black']
|
2023-07-22 13:42:35 +08:00
|
|
|
exclude: >-
|
|
|
|
|
(?x)^(
|
|
|
|
|
.*__init__\.py$
|
|
|
|
|
)
|
2023-08-13 14:02:24 +08:00
|
|
|
|
|
|
|
|
- repo: https://github.com/astral-sh/ruff-pre-commit
|
|
|
|
|
# Ruff version.
|
|
|
|
|
rev: v0.0.284
|
|
|
|
|
hooks:
|
|
|
|
|
- id: ruff
|
|
|
|
|
|
|
|
|
|
- repo: https://github.com/psf/black
|
|
|
|
|
rev: 23.3.0
|
|
|
|
|
hooks:
|
2023-08-15 18:33:58 +08:00
|
|
|
- id: black
|
|
|
|
|
args: ['--line-length', '120']
|