-
Notifications
You must be signed in to change notification settings - Fork 9
/
.pre-commit-config.yaml
77 lines (76 loc) · 3.52 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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
repos:
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.8.0
hooks:
- id: mypy
exclude: "^example/example_proto|^example/proto|^protobuf_to_pydantic/protos|test_p2p_validate.py$|test_pgv_validate.py$|protobuf_to_pydantic/contrib/proto_parser.py|example/validate_example/demo_gen_code_by_pgv.py|example/p2p_validate_example/demo_gen_code_by_p2p.py|protobuf_to_pydantic/_pydantic_adapter.py|protobuf_to_pydantic/customer_validator/__init__.py|protobuf_to_pydantic/customer_validator/v1.py|protobuf_to_pydantic/customer_validator/v2.py|protobuf_to_pydantic/customer_con_type/__init__.py|protobuf_to_pydantic/customer_con_type/v1.py|protobuf_to_pydantic/customer_con_type/v2.py|protobuf_to_pydantic/grpc_types.py"
additional_dependencies:
["types-toml"]
- repo: https://github.com/PyCQA/isort
rev: 5.11.5 # see: https://github.com/PyCQA/isort/issues/2083#issuecomment-1408300628
hooks:
- id: isort
exclude: "^example/example_proto|^example/proto|^protobuf_to_pydantic/protos|protobuf_to_pydantic/_pydantic_adapter.py|protobuf_to_pydantic/grpc_types.py"
- repo: https://github.com/psf/black
rev: 23.1.0
hooks:
- id: black
exclude: "^example/example_proto|^example/proto|^tests|^protobuf_to_pydantic/protos|protobuf_to_pydantic/grpc_types.py"
- repo: https://github.com/PyCQA/flake8
rev: 5.0.4
hooks:
- id: flake8
exclude: "^example/example_proto|^example/proto|^tests|^protobuf_to_pydantic/protos|protobuf_to_pydantic/grpc_types.py"
- repo: https://github.com/myint/autoflake
rev: v1.4
hooks:
- id: autoflake
args: ['--in-place', '--remove-all-unused-imports', '--remove-unused-variable', '--ignore-init-module-imports']
exclude: "^example/example_proto|^example/proto|^tests|^protobuf_to_pydantic/protos|protobuf_to_pydantic/grpc_types.py"
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v3.2.0
hooks:
- id: check-ast
- id: check-byte-order-marker
- id: check-case-conflict
- id: check-docstring-first
- id: check-executables-have-shebangs
- id: check-json
# - id: check-yaml
- id: debug-statements
# - id: detect-private-key
- id: end-of-file-fixer
- id: trailing-whitespace
- id: mixed-line-ending
- repo: https://github.com/python-poetry/poetry
rev: '1.3.0' # add version here
hooks:
- id: poetry-check
- id: poetry-lock
args: ["--no-update"]
- repo: local
hooks:
- id: local-poetry-export
name: my-poetry-export
entry: poetry export
language: python
language_version: python3
pass_filenames: false
args: ["-o", "requirements.txt", "--without-hashes", "--with-credentials" ]
- id: local-poetry-export-dev
name: my-poetry-export
entry: poetry export
language: python
language_version: python3
pass_filenames: false
args: ["-o", "requirements-dev.txt", "--without-hashes", "--with-credentials", "--with", "dev", "--extras=all" ]
- id: local-poetry-export-tox
name: my-poetry-export
entry: bash -c 'cat requirements.txt | grep -v "^grpcio\|^protobuf\|^pydantic" > requirements-no-grpc.txt'
language: system
pass_filenames: false
- id: local-poetry-export-tox-dev
name: my-poetry-export
entry: bash -c 'cat requirements-dev.txt | grep -v "^grpcio\|^protobuf\|^pydantic" > requirements-no-grpc-dev.txt'
language: system
pass_filenames: false