-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Default to latest supported Python version for version-related syntax errors #17529
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
Merged
+139
−71
Merged
Changes from all commits
Commits
Show all changes
29 commits
Select commit
Hold shift + click to select a range
4df7cbb
make LinterSettings::unresolved_target_version optional
ntBre fc4d465
add Checker::target_version_or_latest
ntBre 70853eb
default to PythonVersion::latest for parsing
ntBre 7d82da6
default to latest for import checking
ntBre 040b5ec
default to latest for stdlib imports
ntBre 82d0da1
add some TODOs for later
ntBre af1c355
return Option<PythonVersion> from Checker::target_version
ntBre cead271
use target_version.is_some_and for enabling rules and fix safety
ntBre 48d550b
default to latest for typing imports
ntBre 526dc4e
use default for semantic errors
ntBre 56aa04c
use target_version.is_none_or for disabling rules
ntBre 7f39aa8
use let-else in less clear cases
ntBre 5349480
specify target-version for wasm test
ntBre f45a58e
bail out less aggressively for PLC2801
ntBre ada8154
bail out less aggressively for UP035
ntBre 7a02d4f
add Checker::target_version_or_default
ntBre 4bae9f0
move all lint rules back to `or_default` and remove `target_version`
ntBre ea188dd
revert import default to `default`
ntBre bdd5bd5
default to `latest` for semantic errors, inline helper
ntBre 25f851e
revert to target_version from target_version_or_default
ntBre 1fabd4b
delete TODOs, leave formatter and analyze settings alone for now
ntBre d67e285
unwrap version before check_path
ntBre e7a535d
expand target_version docs
ntBre 4563cd0
save linter_target_version before unwrapping for formatter/analyze
ntBre 2912092
document choice of PythonVersion::latest for semantic errors
ntBre cf284a2
use TargetVersion wrapper
ntBre 5a1b5ce
make LinterSettings::unresolved_target_version a TargetVersion
ntBre 99e50e3
Merge branch 'main' into brent/default-python-version
ntBre 3ef26d0
call target_version instead of accessing the field
ntBre File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
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
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
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
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
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
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
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
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree that this method is still useful. It's somewhat confusing that it's called
target-versionand returns aPythonVersionbut renaming it topython_versionmight be equally confusing because of the method onSemanticSyntaxContext.