-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
DOC: Mention black and PEP8 in pandas style guide #32043
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
Conversation
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.
The idea looks good, just few comments.
@@ -128,6 +128,11 @@ For example: | |||
value = str | |||
f"Unknown received type, got: '{type(value).__name__}'" | |||
|
|||
PEP8 / black |
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.
This is in the wrong section, shouldn't be part of `String formatting.
I think it would make sense to have this as a note at the beginning, than a section of its own.
@@ -128,6 +128,11 @@ For example: | |||
value = str | |||
f"Unknown received type, got: '{type(value).__name__}'" | |||
|
|||
PEP8 / black | |||
------------ | |||
pandas follows the PEP8 standard and uses Black and Flake8 to ensure a |
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 add links to PEP-8, Black,... please
------------ | ||
pandas follows the PEP8 standard and uses Black and Flake8 to ensure a | ||
consistent code format throughout the project. For details see the | ||
contributing guide https://pandas.pydata.org/pandas-docs/stable/development/contributing.html#python-pep8-black. |
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.
This should be using a sphinx reference, so it's automativally rendered as a link, and not the url as text.
and `Flake8 <https://flake8.pycqa.org/en/latest/>`_ to ensure a | ||
consistent code format throughout the project. For details see the | ||
`contributing guide to pandas | ||
<https://pandas.pydata.org/pandas-docs/stable/development/contributing.html#python-pep8-black>`_. |
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.
Sphinx can create links to our own documentation automatically, see for example: https://github.com/pandas-dev/pandas/blame/master/doc/source/ecosystem.rst#L181 which will link to this label: https://github.com/pandas-dev/pandas/blame/master/doc/source/user_guide/options.rst#L1
So, in this case something like:
:ref:`contributing guide to pandas<contributing.code-formatting>`
Should create the link to: https://github.com/pandas-dev/pandas/blame/master/doc/source/development/contributing.rst#L650
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, looks good to me.
@@ -128,7 +134,6 @@ For example: | |||
value = str | |||
f"Unknown received type, got: '{type(value).__name__}'" | |||
|
|||
|
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.
small thing, but do you mind restoring this?
Thanks a lot for your help @datapythonista. Seems that currently it fails tests because of issue #32060. Should work after it resolved. |
I think we've got a temporary fix, can you merge master into your branch? I think CI should pass after that. |
Something went wrong, the diff is huge now, can you have a look please? |
Yes, sorry, I did something wrong. Will try to fix it now. |
If all else fail, run the commands
(USE ONLY AS LAST RESORT) Can anyone show me a better way, I am sure that there is one, I just don't know how to do it. |
In the first section of this post is explained what I do: https://datapythonista.me/blog/useful-git-commands.html |
Thank you for your help! Very much appreciated. |
Bookmarked, thank you @datapythonista |
Thanks @raisadz |
black pandas
git diff upstream/master -u -- "*.py" | flake8 --diff