-
Notifications
You must be signed in to change notification settings - Fork 40
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix ruff parsing for source files with syntax errors (#914)
Ruff now reports syntax errors as a diagnostic with a `null` code.
- Loading branch information
Showing
4 changed files
with
47 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`Testing linter ruff test syntax 1`] = ` | ||
{ | ||
"issues": [ | ||
{ | ||
"code": "E999", | ||
"column": "1", | ||
"file": "test_data/syntax.in.py", | ||
"issueClass": "ISSUE_CLASS_EXISTING", | ||
"issueUrl": "https://docs.astral.sh/ruff/rules/#E999", | ||
"level": "LEVEL_HIGH", | ||
"line": "2", | ||
"linter": "ruff", | ||
"message": "SyntaxError: unexpected EOF while parsing", | ||
"targetType": "python", | ||
}, | ||
], | ||
"lintActions": [ | ||
{ | ||
"command": "lint", | ||
"fileGroupName": "python", | ||
"linter": "ruff", | ||
"paths": [ | ||
"test_data/syntax.in.py", | ||
], | ||
"verb": "TRUNK_VERB_CHECK", | ||
}, | ||
{ | ||
"command": "lint", | ||
"fileGroupName": "python", | ||
"linter": "ruff", | ||
"paths": [ | ||
"test_data/syntax.in.py", | ||
], | ||
"upstream": true, | ||
"verb": "TRUNK_VERB_CHECK", | ||
}, | ||
], | ||
"taskFailures": [], | ||
"unformattedFiles": [], | ||
} | ||
`; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
def f(): { |