Skip to content

Commit eefea55

Browse files
authored
Move mypy linter from test to pre-commit hook (#864)
1 parent 5ed3c25 commit eefea55

File tree

9 files changed

+1315
-992
lines changed

9 files changed

+1315
-992
lines changed

.pre-commit-config.yaml

Lines changed: 83 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -26,50 +26,86 @@
2626

2727
exclude: monitor/dcgm/
2828
repos:
29-
- repo: https://github.com/timothycrosley/isort
30-
rev: 5.12.0
31-
hooks:
32-
- id: isort
33-
additional_dependencies: [toml]
34-
- repo: https://github.com/psf/black
35-
rev: 23.1.0
36-
hooks:
37-
- id: black
38-
types_or: [python, cython]
39-
- repo: https://github.com/PyCQA/flake8
40-
rev: 5.0.4
41-
hooks:
42-
- id: flake8
43-
args: [--max-line-length=88, --select=C,E,F,W,B,B950, --extend-ignore = E203,E501]
44-
types_or: [python, cython]
45-
- repo: https://github.com/pre-commit/mirrors-clang-format
46-
rev: v16.0.5
47-
hooks:
48-
- id: clang-format
49-
types_or: [c, c++, cuda, proto, textproto, java]
50-
args: ["-fallback-style=none", "-style=file", "-i"]
51-
- repo: https://github.com/codespell-project/codespell
52-
rev: v2.2.4
53-
hooks:
54-
- id: codespell
55-
additional_dependencies: [tomli]
56-
args: ["--toml", "pyproject.toml"]
57-
exclude: (?x)^(.*stemmer.*|.*stop_words.*|^CHANGELOG.md$)
58-
# More details about these pre-commit hooks here:
59-
# https://pre-commit.com/hooks.html
60-
- repo: https://github.com/pre-commit/pre-commit-hooks
61-
rev: v4.4.0
62-
hooks:
63-
- id: check-case-conflict
64-
- id: check-executables-have-shebangs
65-
- id: check-merge-conflict
66-
- id: check-json
67-
- id: check-toml
68-
- id: check-yaml
69-
exclude: ^helm-chart/templates\/.*$
70-
- id: check-shebang-scripts-are-executable
71-
- id: end-of-file-fixer
72-
types_or: [c, c++, cuda, proto, textproto, java, python]
73-
- id: mixed-line-ending
74-
- id: requirements-txt-fixer
75-
- id: trailing-whitespace
29+
- repo: https://github.com/timothycrosley/isort
30+
rev: 5.12.0
31+
hooks:
32+
- id: isort
33+
additional_dependencies: [toml]
34+
- repo: https://github.com/psf/black
35+
rev: 23.1.0
36+
hooks:
37+
- id: black
38+
types_or: [python, cython]
39+
- repo: https://github.com/PyCQA/flake8
40+
rev: 5.0.4
41+
hooks:
42+
- id: flake8
43+
args:
44+
[
45+
--max-line-length=88,
46+
--select=C,
47+
E,
48+
F,
49+
W,
50+
B,
51+
B950,
52+
--extend-ignore = E203,
53+
E501,
54+
]
55+
types_or: [python, cython]
56+
- repo: https://github.com/pre-commit/mirrors-clang-format
57+
rev: v16.0.5
58+
hooks:
59+
- id: clang-format
60+
types_or: [c, c++, cuda, proto, textproto, java]
61+
args: ["-fallback-style=none", "-style=file", "-i"]
62+
- repo: https://github.com/codespell-project/codespell
63+
rev: v2.2.4
64+
hooks:
65+
- id: codespell
66+
additional_dependencies: [tomli]
67+
args: ["--toml", "pyproject.toml"]
68+
exclude: (?x)^(.*stemmer.*|.*stop_words.*|^CHANGELOG.md$)
69+
# More details about these pre-commit hooks here:
70+
# https://pre-commit.com/hooks.html
71+
- repo: https://github.com/pre-commit/pre-commit-hooks
72+
rev: v4.4.0
73+
hooks:
74+
- id: check-case-conflict
75+
- id: check-executables-have-shebangs
76+
- id: check-merge-conflict
77+
- id: check-json
78+
- id: check-toml
79+
- id: check-yaml
80+
exclude: ^helm-chart/templates\/.*$
81+
- id: check-shebang-scripts-are-executable
82+
- id: end-of-file-fixer
83+
types_or: [c, c++, cuda, proto, textproto, java, python]
84+
- id: mixed-line-ending
85+
- id: requirements-txt-fixer
86+
- id: trailing-whitespace
87+
88+
- repo: https://github.com/pre-commit/mirrors-mypy
89+
rev: v1.9.0
90+
hooks:
91+
- id: mypy
92+
types_or: [python, cython]
93+
args:
94+
[
95+
"--explicit-package-bases",
96+
"--ignore-missing-imports",
97+
"--show-error-codes",
98+
"--pretty",
99+
"--show-column-numbers",
100+
"--show-error-context",
101+
"--disable-error-code",
102+
"import-untyped",
103+
]
104+
exclude: |
105+
(?x)^(
106+
examples/.*/model\.py|
107+
experiments/.*|
108+
qa/.*/.*config_generator\.py|
109+
qa/.*/check_results\.py|
110+
setup.py|
111+
)$

model_analyzer/monitor/dcgm/dcgm_fields.py

Lines changed: 416 additions & 264 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)