Skip to content

Commit 358ff67

Browse files
committed
Count warnings by keywords, not by lines
Japanese logs have multiline warnings
1 parent caef691 commit 358ff67

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

build_warnings.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
from pathlib import Path
2+
from re import findall
23
from shutil import copyfile
34

45
import sphinx.cmd.build
@@ -33,4 +34,4 @@ def number(clones_dir: str, repo: str, language_code: str) -> int:
3334
)
3435
)
3536
copyfile(warning_file, f'warnings-{language_code}.txt')
36-
return len(Path(warning_file).read_text().splitlines())
37+
return len(findall('ERROR|WARNING', Path(warning_file).read_text()))

0 commit comments

Comments
 (0)