forked from openvinotoolkit/training_extensions
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.pre-commit-config.yaml
98 lines (88 loc) · 2.63 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
default_language_version:
python: python3.8
node: 16.15.0
ruby: 2.7.2
repos:
- repo: https://github.com/PyCQA/isort
rev: "5.12.0"
hooks:
- id: isort
files: '^(otx|tests)/.*\.py'
exclude: "tests/ote_cli"
- repo: https://github.com/psf/black
rev: 22.6.0
hooks:
- id: black
args: [--line-length, "120"]
files: '^(otx|tests)/.*\.py'
exclude: "tests/ote_cli"
- repo: https://github.com/PyCQA/flake8
rev: "5.0.3"
hooks:
- id: flake8
name: "flake8"
files: '^(otx|tests)/.*\.py'
args: ["--config", ".flake8", "--max-complexity", "20"]
exclude: "^(.*/protobuf|tests/ote_cli)|otx/mpa|otx/recipes"
# yaml formatting
- repo: https://github.com/pre-commit/mirrors-prettier
rev: v2.7.1
hooks:
- id: prettier
exclude: "external|otx/mpa|otx/recipes"
- repo: https://github.com/pre-commit/mirrors-mypy
rev: "v0.971"
hooks:
- id: mypy
files: '^(otx)/.*\.py'
additional_dependencies:
[
numpy==1.19.5,
types-PyYAML,
attrs==21.2.*,
types-requests,
types-Deprecated,
types-docutils,
types_futures,
types-python-dateutil,
]
exclude: "^otx/algorithms/anomaly/tests|otx/recipes|otx/mpa"
- repo: https://github.com/PyCQA/pylint
rev: "v2.14.5"
hooks:
- id: pylint
name: "pylint"
files: '^(otx)/.*\.py'
exclude: "tests|otx/mpa|otx/recipes"
entry: pylint
language: system
types: [python]
args: ["--score=no"]
- 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: '^otx/.*\.py'
exclude: "otx/algorithms/anomaly/tests|external/anomaly/tests|otx/cli/utils/tests.py|otx/mpa|otx/recipes"
# Will use rst
# - repo: https://github.com/jumanjihouse/pre-commit-hooks
# rev: 2.1.6
# hooks:
# - id: markdownlint
# # TODO: Check all files even tests after migration to otx is complete
# exclude: "^(ote_sdk|tests|.github|external)"
- repo: https://github.com/AleksaC/hadolint-py
rev: v2.10.0
hooks:
- id: hadolint
name: Lint Dockerfiles
description: Runs hadolint to lint Dockerfiles
- repo: https://github.com/shellcheck-py/shellcheck-py
rev: v0.8.0.4
hooks:
- id: shellcheck # TODO remove this when all shell scripts have been removed from otx