forked from openvinotoolkit/training_extensions
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.pre-commit-config.yaml
86 lines (80 loc) · 2.25 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
default_language_version:
python: python3.8
repos:
- repo: https://github.com/PyCQA/isort
rev: "5.9.2"
hooks:
- id: isort
alias: isort_ote_sdk
name: "isort (ote_sdk)"
args: ["--settings", "ote_sdk/.isort.cfg"]
files: '^ote_sdk/.*\.py'
- id: isort
alias: isort_rest
name: "isort (ote_cli|external)"
args: ["--settings", ".isort.cfg"]
files: '^(ote_cli|external)/.*\.py'
- repo: https://github.com/psf/black
rev: 21.7b0
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/.*\.py'
- repo: https://github.com/PyCQA/flake8
rev: "3.9.2"
hooks:
- id: flake8
name: "flake8"
files: '^(ote_sdk|ote_cli|external)/.*\.py'
args: ["--config", ".flake8", "--max-complexity", "20"]
exclude: ".*/protobuf"
# yaml formatting
- repo: https://github.com/pre-commit/mirrors-prettier
rev: v2.3.0
hooks:
- id: prettier
types: [yaml]
- repo: https://github.com/pre-commit/mirrors-mypy
rev: "v0.812"
hooks:
- id: mypy
alias: mypy_ote_sdk
name: "mypy (ote_sdk)"
files: '^ote_sdk/.*\.py'
args: ["--config-file=ote_sdk/.mypy.ini"]
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'
args: ["--config-file=ote_sdk/.mypy.ini"]
- id: mypy
alias: mypy_rest
name: "mypy (external)"
files: '^external/.*\.py'
args: ["--config-file=ote_sdk/.mypy.ini"]
- repo: local
hooks:
- id: pylint
name: "pylint"
files: '^(ote_sdk|ote_cli|external)/.*\.py'
entry: pylint
language: system
types: [python]
args: ["--score=no", "--rcfile=.pylintrc"]
exclude: "tests"