-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
added python version to parse error message #3323
Conversation
modified `CHANGES.md` modified other relevant markdown files modified relevant tests
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.
Thanks for submitting this, look good apart from a changelog detail 👍
Co-authored-by: Felix Hildén <[email protected]>
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 feel like this will create more user confusion:
% black --target-version py36 -c 'a++'
a++
error: cannot format <string>: Cannot parse (python 3.0): 1:3: a++
% black --target-version py39 -c 'a++'
a++
error: cannot format <string>: Cannot parse (python 3.7): 1:3: a++
Users are going to wonder why it says "3.0" or "3.7" when they never asked for that version.
Co-authored-by: Jelle Zijlstra <[email protected]>
ok, can you help me understand why we parse |
We don't have separate grammars for every version. For py36 we use a grammar with version set to (3, 0). |
ok, so do we have an access to the version that the user provided somewhere? |
It's the target version, which gets passed as a command-line parameter and thence as an argument to |
…pos/black into parse_error_message_version
hey @JelleZijlstra @felix-hilden, i've made some changes, please let me know if this is helpful 😄 |
I'm still not enthusiastic about this:
|
feel free to close this if you're not interested |
Description
improve parsing error message to make sure users know which version it was run on (fixes #3294).
Checklist - did you ...
CHANGES.md
if necessary?