-
-
Notifications
You must be signed in to change notification settings - Fork 18k
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
CI: Check for whitespaces before class #28489
Conversation
#28209 @datapythonista I have created the pull request, was a little unsure but does it look okay? |
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.
Great job @Ayowolet, looks almost perfect, just added couple of comments.
Also, would be great if you can find any class definition in the code, and add the blank line we're trying to detect here. This way, the continuous integration will become red, and we'll see that the check you're adding is working. After we see that it's working, you'll have to revert the blank line, before we can merge.
ci/code_checks.sh
Outdated
@@ -184,6 +184,11 @@ if [[ -z "$CHECK" || "$CHECK" == "patterns" ]]; then | |||
invgrep -R --include="*.rst" ".. ipython ::" doc/source | |||
RET=$(($RET + $?)) ; echo $MSG "DONE" | |||
|
|||
# Check for blank lines after the class definition |
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 don't think we need this comment, it's already explained in the message in the next line.
ci/code_checks.sh
Outdated
@@ -184,6 +184,11 @@ if [[ -z "$CHECK" || "$CHECK" == "patterns" ]]; then | |||
invgrep -R --include="*.rst" ".. ipython ::" doc/source | |||
RET=$(($RET + $?)) ; echo $MSG "DONE" | |||
|
|||
# Check for blank lines after the class definition | |||
MSG='Check for extra blank lines after the class definition' ; echo $MSG | |||
invgrep -R --include="*.py" --include="*.pyx" -E 'class.*:\n\n( )+"""' doc/source/ |
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.
invgrep -R --include="*.py" --include="*.pyx" -E 'class.*:\n\n( )+"""' doc/source/ | |
invgrep -R --include="*.py" --include="*.pyx" -E 'class.*:\n\n( )+"""' . |
The goal here is to check all the Python files in the repo, to standardize classes. The last path doc/source/
is checking only in the documentation directory, where I don't think there are python files, so we want to look in the root instead
pending @datapythonista's suggestion about adding-then-reverting a failing case: LGTM |
@datapythonista when I edit a class and add more spaces, should I commit it to this PR? |
Exactly. The idea is that you add a blank line after the |
Hello @Ayowolet! Thanks for updating this PR. We checked the lines you've touched for PEP 8 issues, and found:
|
Looks like your changes are not working. If you go the the CI, in the What I'd do is next:
Let me know if you need help. Thanks! |
@Ayowolet can you rebase |
@jbrockmendel, I'm not sure I understand what you mean by rebase... |
Near the bottom of this page there is a gray warning saying "This branch has conflicts that must be resolved". To resolve these, you'll need to run |
okay, thank you I will do that |
@Ayowolet can you rebase and see why the check is failing on azure |
If you can please help with the steps for this.. I tried the other method
you suggested but I think the internet connection was too slow and the page
just kept loading for days...
…On Mon, Oct 21, 2019 at 2:30 AM jbrockmendel ***@***.***> wrote:
@Ayowolet <https://github.com/Ayowolet> can you rebase and see why the
check is failing on azure
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#28489?email_source=notifications&email_token=AHZQ67RQ3O54KPZRUZJN6LLQPUA2FA5CNFSM4IXXSKWKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEBYZS5Q#issuecomment-544315766>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AHZQ67WIXGCBTEGB5X2O523QPUA2FANCNFSM4IXXSKWA>
.
|
@Ayowolet the logs have been removed now, but here are a few failures.
I'm not sure what the last one means. You might try running |
The azure page having trouble loading might make more sense, so I'll check that. Looks like the linting is failing because of excess whitespace on tests.test_algos lines 37 and 38 |
I think this is OK. @Ayowolet can you fix the class docstring again so CI turns green? |
@Ayowolet did the trouble with rebasing get resolved? |
cbc2c6b
to
5069cdc
Compare
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.
lgtm
I think the regex could be improved, but this is surely good enough for now, and we can improve it if we ever get false positives.
thanks @Ayowolet |
xref #28209, python-sprints/pandas-mentoring#161
Validate that we use
instead of:
(note the blank line between
class Bar:
and the docstring.