Skip to content

Commit 6760251

Browse files
authored
Recognize SyntaxError: as an error code for ecosystem checks (#16879)
Summary -- This updates the regex in `ruff-ecosystem` to catch syntax errors in an effort to prevent bugs like #16874. This should catch `ParseError`s, `UnsupportedSyntaxError`s, and the upcoming `SemanticSyntaxError`s. Test Plan -- I ran the ecosystem check locally comparing v0.11.0 and v0.11.1 and saw a large number (2757!) of new syntax errors. I also manually tested the regex on a few lines before that. If we merge this before #16878, I'd expect to see that number decrease substantially in that PR too, as another test.
1 parent 23382f5 commit 6760251

File tree

1 file changed

+1
-1
lines changed
  • python/ruff-ecosystem/ruff_ecosystem

1 file changed

+1
-1
lines changed

python/ruff-ecosystem/ruff_ecosystem/check.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
)
4646

4747
CHECK_DIAGNOSTIC_LINE_RE = re.compile(
48-
r"^(?P<diff>[+-])? ?(?P<location>.*): (?P<code>[A-Z]{1,4}[0-9]{3,4})(?P<fixable> \[\*\])? (?P<message>.*)"
48+
r"^(?P<diff>[+-])? ?(?P<location>.*): (?P<code>[A-Z]{1,4}[0-9]{3,4}|SyntaxError:)(?P<fixable> \[\*\])? (?P<message>.*)"
4949
)
5050

5151
CHECK_VIOLATION_FIX_INDICATOR = " [*]"

0 commit comments

Comments
 (0)