forked from WSH032/fastapi-proxy-lib
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.pre-commit-config.yaml
59 lines (56 loc) · 2.15 KB
/
.pre-commit-config.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
# See https://pre-commit.com for more information
# See https://pre-commit.com/hooks.html for more hooks
# # set `default_language_version` need this version of Python existed on the computer
# default_language_version:
# python: python3.10
default_install_hook_types: [pre-commit, commit-msg]
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
hooks:
- id: no-commit-to-branch
- id: check-added-large-files
- id: check-toml
- id: check-json
- id: check-yaml
args:
- --unsafe
- id: end-of-file-fixer
- id: trailing-whitespace
# ruff must before black
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.3.4
hooks:
- id: ruff
alias: ruff # NOTE: don't change this alias, it's used in `ver_sync.py`, keep consistent with `pyproject.toml`
args: [--fix, --exit-non-zero-on-fix]
- repo: https://github.com/psf/black-pre-commit-mirror
rev: 24.3.0
hooks:
- id: black
alias: black # NOTE: don't change this alias, it's used in `ver_sync.py`, keep consistent with `pyproject.toml`
- repo: https://github.com/codespell-project/codespell
rev: v2.2.6
hooks:
- id: codespell
alias: codespell # NOTE: don't change this alias, it's used in `ver_sync.py`, keep consistent with `pyproject.toml`
additional_dependencies:
- tomli
- repo: https://github.com/alessandrojcm/commitlint-pre-commit-hook
rev: v9.13.0
hooks:
- id: commitlint
stages: [commit-msg]
# NOTE: the dependencies must consistent with `commitlint.config.js`
additional_dependencies: ["@commitlint/config-conventional"]
- repo: local
hooks:
- id: ver_sync
stages: [pre-commit]
name: synchronize versions of lint tools
entry: python scripts/pre_commit_scripts/ver_sync.py
language: python
additional_dependencies:
- tomlkit == 0.12.* # TODO: Once it releases version 1.0.0, we will remove this restriction.
- ruamel.yaml == 0.18.* # TODO: Once it releases version 1.0.0, we will remove this restriction.
- packaging == 23.*