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

STY: Removed unconcatenated strings #30464

Merged
merged 7 commits into from
Dec 25, 2019

Conversation

ShaharNaveh
Copy link
Member

@ShaharNaveh ShaharNaveh commented Dec 25, 2019

@ShaharNaveh ShaharNaveh force-pushed the CI-str-concatenated branch 2 times, most recently from 3adbc5c to c38e1ce Compare December 25, 2019 10:42
@ShaharNaveh ShaharNaveh marked this pull request as ready for review December 25, 2019 10:43
@alimcmaster1 alimcmaster1 added the CI Continuous Integration label Dec 25, 2019

Returns
-------
int
Copy link
Member

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

Copy link
Member Author

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):
Copy link
Member

Choose a reason for hiding this comment

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

Could add type?

Copy link
Member Author

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

Copy link
Member

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?

Copy link
Member Author

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?

I really don't know.

Copy link
Member Author

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?

@alimcmaster1 #30467 (comment)

tok2 = toks[i + 1]
if tok[0] == token.STRING and tok[0] == tok2[0]:
print(
"{file_path}:{line_number}:\t{start} and {end}".format(
Copy link
Member

Choose a reason for hiding this comment

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

f string?

Copy link
Member Author

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 😄

#!/usr/bin/env python
"""
Check where there is a string that needs to be concatenated.
"""
Copy link
Member

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

@datapythonista
Copy link
Member

@MomIsBestFriend do you mind opening a PR for the script and the call to the script in ci/code_checks.sh? And just leave here the fixes.

The fixes should be non-trivial to get merged, but not the script (I think we should try using regex for it). Thanks!

@ShaharNaveh
Copy link
Member Author

@MomIsBestFriend do you mind opening a PR for the script and the call to the script in ci/code_checks.sh? And just leave here the fixes.

The fixes should be non-trivial to get merged, but not the script (I think we should try using regex for it). Thanks!

Sure

@ShaharNaveh ShaharNaveh changed the title CI: Added unwanted patterns check STY: Removed unconcatenated strings Dec 25, 2019
Copy link
Member

@datapythonista datapythonista left a 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.

@jreback jreback added this to the 1.0 milestone Dec 25, 2019
@jreback jreback added Code Style Code style, linting, code_checks and removed CI Continuous Integration labels Dec 25, 2019
@jreback jreback merged commit 7f3d7b9 into pandas-dev:master Dec 25, 2019
@jreback
Copy link
Contributor

jreback commented Dec 25, 2019

thanks @MomIsBestFriend

@ShaharNaveh ShaharNaveh deleted the CI-str-concatenated branch December 26, 2019 19:40
AlexKirko pushed a commit to AlexKirko/pandas that referenced this pull request Dec 29, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Code Style Code style, linting, code_checks
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants