Adopt basedpyright with a legacy baseline#2194
Merged
Merged
Conversation
Limit analysis to the production and deprecation-test scope already checked by mypy so unrelated tests and fuzz targets do not block adoption. Pin basedpyright for reproducible diagnostics and baseline the existing standard-mode findings. This preserves the current code while making new errors and warnings fail CI. Run the check in one Linux matrix job to avoid duplicating the same fixed-target analysis across every platform and interpreter. Co-authored-by: Sebastian Thiel <sebastian.thiel@icloud.com>
Contributor
There was a problem hiding this comment.
Pull request overview
This PR introduces basedpyright as an additional type-checking tool for GitPython, aiming to enable incremental adoption by checking a limited subset of the codebase and adding a legacy diagnostics baseline.
Changes:
- Add
basedpyrightto test dependencies and configure[tool.basedpyright]includes inpyproject.toml. - Add a GitHub Actions step to run basedpyright on Ubuntu / Python 3.12.
- Add
.basedpyright/baseline.jsonto track existing diagnostics for incremental cleanup.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
test-requirements.txt |
Adds a pinned basedpyright dependency for supported Python/platforms. |
pyproject.toml |
Configures basedpyright to type-check git/ and test/deprecation/. |
.github/workflows/pythonpackage.yml |
Runs basedpyright in CI (Ubuntu / Python 3.12). |
.basedpyright/baseline.json |
Introduces a legacy baseline of current diagnostics for gradual adoption. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
The idea is to one fine day make Zed not light up anymore when looking at the code.
So far, it's not working though, but this PR is a start.