feat: Support basedpyright linter#990
Open
phuongfi91 wants to merge 6 commits into
Open
Conversation
Member
|
can you rebase this please - |
Member
|
@phuongfi91 - can you resolve the conflicts - would like to get this in |
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Adds support for the basedpyright type-checker as a linter plugin, including a JSON→SARIF converter and a basic linter snapshot test.
Changes:
- Introduce
basedpyrightplugin definition + lint command wiring. - Add a Python parser (
basedpyright_to_sarif.py) to convert basedpyright JSON diagnostics into SARIF. - Add basic fixture input + Jest snapshot to validate emitted issues.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| linters/basedpyright/plugin.yaml | Registers basedpyright tool and check command, wiring output through a custom parser. |
| linters/basedpyright/basedpyright_to_sarif.py | Converts basedpyright --outputjson diagnostics to SARIF results. |
| linters/basedpyright/basedpyright.test.ts | Adds a smoke test invoking the linter check harness. |
| linters/basedpyright/test_data/basic.in.py | Adds Python source fixture intended to trigger representative diagnostics. |
| linters/basedpyright/test_data/basedpyright_v1.28.1_basic.check.shot | Adds snapshot of expected issues emitted by basedpyright + parser. |
| README.md | Documents basedpyright as a supported Python linter and adds link reference. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+44
to
+48
| sarif = { | ||
| "$schema": "https://raw.githubusercontent.com/oasis-tcs/sarif-spec/master/Schemata/sarif-schema-2.1.0.json", | ||
| "version": "2.1.0", | ||
| "runs": [{"results": results}], | ||
| } |
|
|
||
| results = [] | ||
|
|
||
| for result in json.load(sys.stdin)["generalDiagnostics"]: |
| } | ||
| ], | ||
| "message": { | ||
| "text": result["message"].replace("Â", ""), |
| @@ -0,0 +1,57 @@ | |||
| from typing import Callable, Iterator, Union, Optional, Enum | |||
|
|
||
| class A: | ||
| x: int = 0 # Regular class variable | ||
| y: ClassVar[int] = 0 # Pure class variable |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
basedpyrightis a fork ofpyrightso they should be quite similar to each other. Let's support it 😎