-
-
Notifications
You must be signed in to change notification settings - Fork 3k
Update update_data.py: make the space in error comments optional #19546
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
Open
wyattscarpenter
wants to merge
15
commits into
python:master
Choose a base branch
from
wyattscarpenter:espace
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
eb75b05
Update update_data.py: make the space in error comments optional
wyattscarpenter 8bb4ff6
Update README.md: docu for the spacedness thing
wyattscarpenter 47f82d4
Update data.py: continue implementing optional spacedness
wyattscarpenter 25b28c9
Update data.py: actually use re split
wyattscarpenter 9705f73
Update data.py: use raw strings
wyattscarpenter 59a14cb
Update README.md: remember that markdown also uses backslash escapes
wyattscarpenter ba6afdb
be more strict, but also more lenient, about error code comment format
wyattscarpenter 467fdf1
message may include leading spaces
wyattscarpenter a56bebc
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] a429c05
Handle zero-indent case in rewrite
wyattscarpenter 796adda
fix broken tests, elaborate on test file format in the readme
wyattscarpenter 33504bb
I hate black param wrapping on things that should be a single line
wyattscarpenter 1bc3676
make tests
wyattscarpenter fd636a1
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] 55f3e68
typo
wyattscarpenter 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
[case noErrorComment] | ||
x: int = 1 | ||
|
||
[case prototypicalErrorComment] | ||
x: int = "hi" # E: Incompatible types in assignment (expression has type "str", variable has type "int") | ||
|
||
[case emptyLineErrorComment-xfail] | ||
# E: | ||
|
||
[case oddErrorComments] | ||
x: int = "hi"#E: Incompatible types in assignment (expression has type "str", variable has type "int") | ||
x2: int = "hi" #E: Incompatible types in assignment (expression has type "str", variable has type "int") | ||
x3: int = "hi" # E: Incompatible types in assignment (expression has type "str", variable has type "int") | ||
x4: int = "hi" # E : Incompatible types in assignment (expression has type "str", variable has type "int") | ||
x5: int = "hi" # E : Incompatible types in assignment (expression has type "str", variable has type "int") | ||
x6: int = "hi" # E : Incompatible types in assignment (expression has type "str", variable has type "int") | ||
x7: int = "hi" # E : Incompatible types in assignment (expression has type "str", variable has type "int") | ||
x8: int = "hi" \ | ||
# E : Incompatible types in assignment (expression has type "str", variable has type "int") | ||
x82: int = "hi"\ | ||
# E : Incompatible types in assignment (expression has type "str", variable has type "int") | ||
|
||
[case oddErrorCommentsNoteComment] | ||
n: int | ||
reveal_type(n) # N: Revealed type is "builtins.int" | ||
|
||
|
||
[case oddErrorCommentsThatDontWork-xfail] | ||
-- The space between the ":" and the message actually differs in the output, which we match against | ||
-- so we can't just parse it and replace it; therefore, these do not work. | ||
x: int = "hi"#E:Incompatible types in assignment (expression has type "str", variable has type "int") | ||
x2: int = "hi" #E:Incompatible types in assignment (expression has type "str", variable has type "int") | ||
x3: int = "hi" # E : Incompatible types in assignment (expression has type "str", variable has type "int") | ||
x4: int = "hi" # E : Incompatible types in assignment (expression has type "str", variable has type "int") | ||
x5: int = "hi" # E : Incompatible types in assignment (expression has type "str", variable has type "int") | ||
|
||
[case oddErrorCommentsThatDontWorkCase-xfail] | ||
-- I just didn't bother to implement these. | ||
x: int = "hi" # e: Incompatible types in assignment (expression has type "str", variable has type "int") | ||
x: int = "hi" # w: Incompatible types in assignment (expression has type "str", variable has type "int") | ||
x: int = "hi" # n: Incompatible types in assignment (expression has type "str", variable has type "int") | ||
|
||
|
||
[case oddErrorCommentsThatDontWorkCaseAndNoColon-xfail] | ||
-- I didn't implement these. This is veering towards the ambiguous. | ||
x: int = "hi" # e: Incompatible types in assignment (expression has type "str", variable has type "int") | ||
x2: int = "hi" # E Incompatible types in assignment (expression has type "str", variable has type "int") | ||
x3: int = "hi" # e Incompatible types in assignment (expression has type "str", variable has type "int") | ||
x4: int = "hi" # e Incompatible types in assignment (expression has type "str", variable has type "int") |
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
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.