Skip to content
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

Support files with type comment syntax errors #3594

Merged
merged 11 commits into from
Mar 19, 2023

Conversation

tusharsadhwani
Copy link
Contributor

@tusharsadhwani tusharsadhwani commented Mar 4, 2023

Description

Resolves #3593

Checklist - did you ...

  • Add an entry in CHANGES.md if necessary?
  • Add / update tests if necessary?
  • Add new / update outdated documentation?

@github-actions
Copy link

github-actions bot commented Mar 4, 2023

diff-shades reports zero changes comparing this PR (c11c3eb) to main (6ffc5f7).


What is this? | Workflow run | diff-shades documentation

tests/test_black.py Outdated Show resolved Hide resolved
src/black/parsing.py Outdated Show resolved Hide resolved
src/black/parsing.py Outdated Show resolved Hide resolved
@ichard26 ichard26 self-requested a review March 6, 2023 15:52
@tusharsadhwani
Copy link
Contributor Author

@ichard26 can you help with re-triggering the workflows?

@JelleZijlstra
Copy link
Collaborator

@ichard26 do you still want to look at this or can I merge it?

Copy link
Collaborator

@ichard26 ichard26 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wanted to take a look because this PR falls back to using the built-in ast module even on Python 3.7 which we avoided doing previously, but that's a really minor edge case — so it's fine. All it might do is make some files with invalid type comments still unparsable.

@ichard26 ichard26 merged commit 53c23e6 into psf:main Mar 19, 2023
@ichard26
Copy link
Collaborator

Thanks for the PR @tusharsadhwani!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Let black run on files even if ast.parse with type_comments=True fails
3 participants