-
Notifications
You must be signed in to change notification settings - Fork 1.4k
[syntax-errors] Start detecting compile-time syntax errors #16106
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
Merged
Changes from all commits
Commits
Show all changes
52 commits
Select commit
Hold shift + click to select a range
c66f37a
try SourceOrderVisitor and hack into red-knot
ntBre 825f971
ignore syntax diagnostics in red-knot tests
ntBre 4e702dd
integrate with ruff, accept snap changes
ntBre 877a108
implement F404 too
ntBre af9d9dd
just use SyntaxChecker::enter_stmt instead of SourceOrderVisitor
ntBre 6f90709
update doc comment
ntBre ab2db92
tidy enter_stmt
ntBre c4a5cc7
move red_knot_python_semantic::PythonVersion to ruff_db
ntBre 34b5829
add docs to VersionSyntaxError
ntBre 6cc9198
revert red-knot integration
ntBre 508d785
revert MatchBeforePy310 detection
ntBre 9c38e2d
revert version-related diagnostic kind
ntBre da6d31d
add a failing test for comprehension rebinding
ntBre 33b5381
start detecting list comprehensions but can't display messages yet
ntBre 419b5cd
restore testing code, add a TestVisitor
ntBre 662ffc3
factor out check_generator_expr, check other comprehensions
ntBre 63276ef
delete linter test, at least for now
ntBre ca582a5
use a Visitor to traverse generator elts, add more test cases
ntBre f461718
emit new errors in ruff
ntBre 67eb290
preview gate
ntBre 38ee75d
add ruff test
ntBre dc1a94a
remove now-unused FUTURES_BOUNDARY flag and shift others down
ntBre edbc46c
fix crate version
ntBre 6e131f6
update docs
ntBre 659788a
remove unused as_str method
ntBre 7d00d50
Merge branch 'main' into brent/syntax-error-source-order
ntBre c3417be
update LinterResult flag name and docs
ntBre d6d3437
prepend new types with Semantic
ntBre 7144a82
make rebound_variable a Vec, add a test with multiple violations
ntBre ffdb7cb
rename enter_ methods to visit_
ntBre 16479d4
don't build a HashSet
ntBre ef11801
target_version -> python_version
ntBre 4cfaad0
report semantic errors even when AST-based rules are not selected
ntBre f1b2222
add context trait and pass to visit_stmt
ntBre ae17231
move python version into context trait too
ntBre a363c6b
move preview check to check_ast to avoid collecting at all
ntBre d48afb7
remove separate crate, put SemanticSyntaxChecker in the parser
ntBre 7ffa680
expand inline tests to semantic_errors module
ntBre c482a02
test --statistics for all three kinds of errors
ntBre 88cbb9b
fix outdated docs links
ntBre 5f7de2a
move interior mutability to Checker
ntBre e8d44f1
update checker field name and add docs (also fix an old missing `.`)
ntBre 7171e20
fix LinterResult docs
ntBre 077bd37
reorder SemanticSyntaxChecker code to navigate more easily
ntBre f484a85
combine semantic error tests with existing inline tests
ntBre de0914b
move inline tests just above add_error call
ntBre 3ccea07
delete getter/setter without refcell
ntBre 0b62bde
restore docs from SemanticModel flag, delete todo
ntBre 452283a
move semantic_errors to single-file module
ntBre b5f828b
delete outdated comment
ntBre ab89b04
update variable name to match LinterResult field
ntBre 79ddb2f
delete now-unused inline/semantic directory
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
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.
Uh oh!
There was an error while loading. Please reload this page.