-
-
Notifications
You must be signed in to change notification settings - Fork 18.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
STY: Removed unconcatenated strings #30464
Conversation
3adbc5c
to
c38e1ce
Compare
|
||
Returns | ||
------- | ||
int |
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.
Feels like a bool would be a more appropriate return type if this function is only ever going to return 0/1
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 did also thought so, but I am relying on an exit status, so int feels more native.
sys.exit(0) | ||
|
||
|
||
def is_concatenated(file_path): |
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.
Could add 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.
At first I typed this whole script, but it said it was a syntax error, same with f-strings
, I think that the running platform of this is python 3.5
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.
Hmm - we run validate_docstrings.py
as part of code_checks.sh
which has 3.6 + syntax?
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.
Hmm - we run
validate_docstrings.py
as part ofcode_checks.sh
which has 3.6 + syntax?
I really don't know.
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.
Hmm - we run
validate_docstrings.py
as part ofcode_checks.sh
which has 3.6 + syntax?
tok2 = toks[i + 1] | ||
if tok[0] == token.STRING and tok[0] == tok2[0]: | ||
print( | ||
"{file_path}:{line_number}:\t{start} and {end}".format( |
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.
f string?
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.
Oh, I already answered above 😄
4adf8de
to
d920bfd
Compare
#!/usr/bin/env python | ||
""" | ||
Check where there is a string that needs to be concatenated. | ||
""" |
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.
can you flesh this out with a GH reference and a sentence about how black
causes the issue
@MomIsBestFriend do you mind opening a PR for the script and the call to the script in The fixes should be non-trivial to get merged, but not the script (I think we should try using regex for it). Thanks! |
Sure |
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 @MomIsBestFriend, really nice clean up.
thanks @MomIsBestFriend |
black pandas
git diff upstream/master -u -- "*.py" | flake8 --diff