-
-
Notifications
You must be signed in to change notification settings - Fork 8
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
Handle docstrings in single quoted strings correctly #46
Conversation
Pull Request Test Coverage Report for Build 1824561971
💛 - Coveralls |
return tokenize.TokenInfo( | ||
tokeninfo.type, | ||
self._treat_string(tokeninfo, tokeninfo.start[1]), | ||
self._treat_string(tokeninfo, tokeninfo.start[1], quotes), |
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.
Maybe we could handle the quote detection in this function and give the string to the function ? And maybe create a StringWithOriginalQuoteFormatter
? It would make less arguments passed around ànd named _
for StringFormatter
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.
Maybe we could handle the quote detection in this function and give the string to the function ?
We're doing that now right?
And maybe create a
StringWithOriginalQuoteFormatter
? It would make less arguments passed around ànd named_
forStringFormatter
Good idea! I will do that!
36de5bf
to
ddc496a
Compare
Note, this should be rebased not squashed due to the other two commits. |
tokeninfo, | ||
tokeninfo.start[1], | ||
quotes, | ||
quotes_length, # type: ignore[arg-type] |
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.
Both mypy
and pyright
don't acknowledge that quotes_length
is 1
or 3
. pyright
does if you use (1,3)
, but then pylint
complains about set comparison.
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.
👌
Fixes a part of #45.
I'd like to add the quotes formatter as well to
0.4.0
so we can also fix the underlying issue when running the formatter overpylint
😄