-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use a stricter configuration for basedpyright #332
Conversation
ccc29b0
to
45c4b47
Compare
bfbdfb6
to
66c989c
Compare
This also modifies the diagnositic behavior for various circumstances. This currently leaves all of the rules that would cause errors explicitly disabled, while leaving everything else enabled. Over time, the rules which were disabled for this reason will be re-enabled and the corresponding issues will be fixed in future commits.
2a350b8
to
347dd59
Compare
Note: Unknown type reporting is currently disabled, there is a comment in Note 2: I've added some TODO comments into the code-base, which were not actually resolved here. That's because these TODOs are completely unrelated to this PR and are essentially just issues that I've noticed while working on this. These should be fixed in another PR(s) some time in the future. |
Marking this as draft again, pending the consideration of enabling |
Marking as ready again: |
A type checker that isn't strict is a bad type checker
This moves us from the previously used
typeCheckingMode
, set asstandard
to usingall
, with some explicity disabled diagnostics, which we don't want to enforce (blacklist model). This is generally a better idea, as it will also auto-enable any new rules introduced into basedpyright even if they aren't enabled in the mode we're using by default, allowing us to make the conscious decision of whether or not we want to enable it.Warning
This will likely break all PRs :P
Note that this is the rare case where if you wish to bring your PR up to date with
main
, you will want to do a propergit merge
as opposed togit rebase
, so that you can bring your code up-to-date with these changes in that merge commit, rather than having to edit each commit in a rebase to be compatible. Unless you only have very few commits (1-3), or your commits don't change code a lot (documentation PRs).This is because a rebase would require you to get your code added after these commits will have already been made, which means you will likely encounter git conflicts on every single commit (and even if it won't straight up be git conflicts, your own new code will likely no longer be valid for that commit, as it won't be passing the new stricter type-checker configuration), forcing you to edit that commit. With a lot of commits, you will end up having to edit pretty much all of them one by one, while with a proper merge, you can simply fix the type issues in a single merge commit.