Skip to content

Commit 45a9833

Browse files
pre-commit config: Fix check: python-check-blanket-type-ignore
Signed-off-by: Bernhard Kaindl <[email protected]>
1 parent 70d84ba commit 45a9833

File tree

2 files changed

+12
-8
lines changed

2 files changed

+12
-8
lines changed

.pre-commit-config.yaml

+11-7
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
# https://github.com/dexpota/cheatsheets/blob/master/pre-commit
3838
exclude: "^tests/data"
3939
fail_fast: true
40-
default_stages: [commit]
40+
default_stages: [pre-commit]
4141
repos:
4242
- repo: local
4343
hooks:
@@ -62,6 +62,14 @@ repos:
6262
- isort
6363

6464

65+
- repo: https://github.com/pre-commit/pygrep-hooks
66+
rev: v1.10.0 # Use the ref you want to point at
67+
hooks:
68+
# Enforce that `# type: ignore` annotations always occur with specific codes.
69+
# Sample annotation: # type: ignore[attr-defined,name-defined]
70+
- id: python-check-blanket-type-ignore
71+
72+
6573
- repo: https://github.com/pre-commit/mirrors-mypy
6674
rev: v1.10.0
6775
hooks:
@@ -124,12 +132,8 @@ repos:
124132
language: python
125133
require_serial: true
126134
pass_filenames: false
127-
- repo: https://github.com/pre-commit/pygrep-hooks
128-
rev: v1.10.0 # Use the ref you want to point at
129-
hooks:
130-
# Enforce that `# type: ignore` annotations always occur with specific codes.
131-
# Sample annotations: # type: ignore[attr-defined] # type: ignore[attr-defined,name-defined]
132-
- id: python-check-blanket-type-ignore
135+
136+
133137
- repo: https://github.com/pre-commit/pre-commit-hooks
134138
rev: v4.6.0
135139
hooks:

pytype_runner.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ def run_pytype(command: List[str], branch_url: str, errorlog: TextIO, results):
7777
ok = True
7878
while ok:
7979
for key, _ in sel.select():
80-
line = key.fileobj.readline() # type: ignore
80+
line = key.fileobj.readline() # type: ignore[union-attr]
8181
if not line:
8282
ok = False
8383
break

0 commit comments

Comments
 (0)