Skip to content

Commit 56e2714

Browse files
committed
fix pyrefly error parsing
1 parent 51b2be0 commit 56e2714

File tree

3 files changed

+18
-17
lines changed

3 files changed

+18
-17
lines changed
Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
1-
conformant = "Unsupported"
2-
conformance_automated = "Fail"
1+
conformant = "Pass"
2+
conformance_automated = "Pass"
33
errors_diff = """
4-
Line 18: Expected 1 errors
5-
Line 24: Expected 1 errors
6-
Line 25: Expected 1 errors
7-
Line 30: Expected 1 errors
8-
Line 41: Expected 1 errors
9-
Line 42: Expected 1 errors
10-
Line 44: Expected 1 errors
11-
Line 47: Expected 1 errors
12-
Line 48: Expected 1 errors
13-
Line 58: Expected 1 errors
14-
Line 69: Expected 1 errors
15-
Line 98: Expected 1 errors
164
"""
175
output = """
6+
WARN directives_deprecated.py:18:44-47: `Ham` is deprecated [deprecated]
7+
WARN directives_deprecated.py:24:1-23: `_directives_deprecated_library.norwegian_blue` is deprecated [deprecated]
8+
WARN directives_deprecated.py:25:5-27: `_directives_deprecated_library.norwegian_blue` is deprecated [deprecated]
9+
WARN directives_deprecated.py:30:12-15: Call to deprecated overload `_directives_deprecated_library.foo` [deprecated]
10+
WARN directives_deprecated.py:41:5-13: `+` is not supported between `Spam` and `Literal[1]` [deprecated]
11+
WARN directives_deprecated.py:42:1-10: `+=` is not supported between `Spam` and `Literal[1]` [deprecated]
12+
WARN directives_deprecated.py:44:1-12: `_directives_deprecated_library.Spam.greasy` is deprecated [deprecated]
13+
WARN directives_deprecated.py:47:1-11: `_directives_deprecated_library.Spam.shape` is deprecated [deprecated]
14+
WARN directives_deprecated.py:48:1-11: `_directives_deprecated_library.Spam.shape` is deprecated [deprecated]
15+
WARN directives_deprecated.py:58:1-10: `Invocable.__call__` is deprecated [deprecated]
16+
WARN directives_deprecated.py:69:1-6: `lorem` is deprecated [deprecated]
17+
WARN directives_deprecated.py:98:5-10: `SupportsFoo1.foo` is deprecated [deprecated]
1818
"""

conformance/results/results.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1008,7 +1008,7 @@ <h3>Python Type System Conformance Test Results</h3>
10081008
<th class="column col2 conformant">Pass</th>
10091009
<th class="column col2 conformant">Pass</th>
10101010
<th class="column col2 conformant">Pass</th>
1011-
<th class="column col2 not-conformant">Unsupported</th>
1011+
<th class="column col2 conformant">Pass</th>
10121012
</tr>
10131013
<tr><th class="column col1">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;directives_no_type_check</th>
10141014
<th class="column col2 partially-conformant"><div class="hover-text">Partial<span class="tooltip-text" id="bottom"><p>Does not honor `@no_type_check` class decorator (allowed).</p><p>Does not reject invalid call of `@no_type_check` function.</p></span></div></th>

conformance/src/type_checker.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -307,13 +307,15 @@ def run_tests(self, test_files: Sequence[str]) -> dict[str, str]:
307307
for line in lines:
308308
if not line.strip():
309309
continue
310+
if line.startswith(" INFO "):
311+
continue
310312
# Extract the absolute path reported by pyrefly and convert it to a
311313
# stable relative path (filename only) so results are consistent.
312314
# Example input line:
313315
# "ERROR /abs/.../conformance/tests/foo.py:12:3-5: message [code]"
314316
# We replace the absolute path with just "foo.py".
315317
try:
316-
abs_path = line.split(":", 1)[0].split(" ", 1)[1].strip()
318+
abs_path = line.split(":", 1)[0].strip().split(" ", 1)[1].strip()
317319
except IndexError:
318320
# If parsing fails, fall back to original line and grouping.
319321
abs_path = ""
@@ -324,7 +326,6 @@ def run_tests(self, test_files: Sequence[str]) -> dict[str, str]:
324326
results_dict[file_name] = (
325327
results_dict.get(file_name, "") + display_line + "\n"
326328
)
327-
328329
return results_dict
329330

330331
def parse_errors(self, output: Sequence[str]) -> dict[int, list[str]]:

0 commit comments

Comments
 (0)