forked from openvinotoolkit/training_extensions
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.pre-commit-config.yaml
99 lines (92 loc) · 2.7 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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
default_language_version:
python: python3.8
node: 16.15.0
repos:
- repo: https://github.com/PyCQA/isort
rev: "5.10.1"
hooks:
- id: isort
alias: isort_ote_sdk
name: "isort (ote_sdk)"
files: '^ote_sdk/.*\.py'
- id: isort
alias: isort_rest
name: "isort (ote_cli|external)"
files: '^(ote_cli|external/anomaly|external/model-preparation-algorithm)/.*\.py'
exclude: "tests/"
- repo: https://github.com/psf/black
rev: 22.6.0
hooks:
- id: black
name: "black (ote_sdk|ote_cli)"
args: [--line-length, "88"]
files: '^(ote_sdk|ote_cli)/.*\.py'
- id: black
name: "black (rest)"
args: [--line-length, "120"]
files: '^(external/anomaly|external/model-preparation-algorithm)/.*\.py'
- repo: https://github.com/PyCQA/flake8
rev: "5.0.3"
hooks:
- id: flake8
name: "flake8"
files: '^(ote_sdk|ote_cli|external/anomaly|external/model-preparation-algorithm)/.*\.py'
args: ["--config", ".flake8", "--max-complexity", "20"]
exclude: ".*/protobuf"
# yaml formatting
- repo: https://github.com/pre-commit/mirrors-prettier
rev: v2.7.1
hooks:
- id: prettier
exclude: "external/deep-object-reid"
- repo: https://github.com/pre-commit/mirrors-mypy
rev: "v0.971"
hooks:
- id: mypy
alias: mypy_ote_sdk
name: "mypy (ote_sdk)"
files: '^ote_sdk/.*\.py'
additional_dependencies:
[
numpy==1.19.5,
types-PyYAML,
attrs==21.2.*,
types-requests,
types-Deprecated,
types-docutils,
types_futures,
types-python-dateutil,
]
- id: mypy
alias: mypy_ote_cli
name: "mypy (ote_cli)"
files: '^ote_cli/.*\.py'
additional_dependencies: [types-PyYAML]
- id: mypy
alias: mypy_anomaly
name: "mypy (anomaly)"
files: '^external/anomaly/.*\.py'
additional_dependencies: [attrs==21.2.*]
exclude: "^external/anomaly/tests"
- repo: https://github.com/PyCQA/pylint
rev: "v2.14.5"
hooks:
- id: pylint
name: "pylint"
files: '^(ote_sdk|ote_cli|external/anomaly)/.*\.py'
entry: pylint
language: system
types: [python]
args: ["--score=no"]
exclude: "tests"
- repo: https://github.com/PyCQA/pydocstyle
rev: 6.1.1
hooks:
- id: pydocstyle
additional_dependencies: [toml]
name: pydocstyle
entry: pydocstyle
language: python
types: [python]
files: '^external/anomaly/.*\.py'
exclude: "external/anomaly/tests"