Skip to content

Commit 6f10160

Browse files
committed
fix: scripts/ errors
1 parent e79e0bd commit 6f10160

File tree

2 files changed

+12
-10
lines changed

2 files changed

+12
-10
lines changed

scripts/release_branch.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,13 @@
33
"""
44

55
import glob
6-
import tomllib
7-
import toml
86
import subprocess
97
import sys
108

9+
# Ignoring errors since this script is run in a controlled environment
10+
import toml # type: ignore # pyright: ignore[reportMissingModuleSource]
11+
import tomllib # type: ignore # pyright: ignore[reportMissingImports]
12+
1113

1214
def main(*args):
1315
pkg = args[1]

scripts/update_mypy_ruff.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
"""python scripts/update_mypy_ruff.py"""
22

33
import glob
4-
import tomllib
4+
import re
5+
import subprocess
56
from pathlib import Path
67

7-
import toml
8-
import subprocess
9-
import re
8+
# Ignoring errors since this script is run in a controlled environment
9+
import toml # type: ignore # pyright: ignore[reportMissingModuleSource]
10+
import tomllib # type: ignore # pyright: ignore[reportMissingImports]
1011

1112
ROOT_DIR = Path(__file__).parents[1]
1213

@@ -50,10 +51,9 @@ def main():
5051

5152
to_ignore = {}
5253
for l in logs:
53-
if re.match("^(.*)\:(\d+)\: error:.*\[(.*)\]", l):
54-
path, line_no, error_type = re.match(
55-
"^(.*)\:(\d+)\: error:.*\[(.*)\]", l
56-
).groups()
54+
match = re.match(r"^(.*):(\d+): error:.*\[(.*)\]", l)
55+
if match:
56+
path, line_no, error_type = match.groups()
5757
if (path, line_no) in to_ignore:
5858
to_ignore[(path, line_no)].append(error_type)
5959
else:

0 commit comments

Comments
 (0)