diff --git a/doc/source/development/contributing.rst b/doc/source/development/contributing.rst index 1c552ad95c842b..dd9c9f39ce3a54 100644 --- a/doc/source/development/contributing.rst +++ b/doc/source/development/contributing.rst @@ -569,8 +569,7 @@ do not make sudden changes to the code that could have the potential to break a lot of user code as a result, that is, we need it to be as *backwards compatible* as possible to avoid mass breakages. -Additional standards are outlined on the (Placeholder as a reminder to ask the -devs for the help on how to properly link the new created file) +Additional standards are outlined on the `pandas code style guide `_ Optional dependencies --------------------- diff --git a/doc/source/development/contributing_code_style.rst b/doc/source/development/contributing_code_guide.rst similarity index 66% rename from doc/source/development/contributing_code_style.rst rename to doc/source/development/contributing_code_guide.rst index fa8b2a86ae4b78..57119192789f1e 100644 --- a/doc/source/development/contributing_code_style.rst +++ b/doc/source/development/contributing_code_guide.rst @@ -1,4 +1,4 @@ -.. _Not_sure_what_to_put_here: +.. _contributing_code_guide: {{ header }} @@ -121,79 +121,12 @@ For example: .. code-block:: python - raise ValueError(f"Unknown recived value, got: {repr(value)}") + value = str + f"Unknown recived value, got: {repr(value)}" **Good:** .. code-block:: python - raise ValueError(f"Unknown recived type, got: '{type(value).__name__}'") - -**Bad:** - -.. code-block:: python - - raise ValueError(f"Unknown recived type, got: {repr(type(value).__name__)}") - -Single and double quotes ------------------------- - -*pandas* uses single quotes when .... - -For example: - -**Good:** - -.. code-block:: python - - placeholder = True - - -**Bad:** - -.. code-block:: python - - placeholder = True - -And using double quotes when.... - -For example: - -**Good:** - -.. code-block:: python - - placeholder = True - - -**Bad:** - -.. code-block:: python - - placeholder = True - -Typing -====== - -Annotating __init__ -------------------- - -*pandas* does not annotate the '__init__' function. it is redundant -as almost every '__init__' function will most like not to return anything. - -For example: - -**Good:** - -.. code-block:: python - - def __init__(self, name): - self.name = name - -**Bad:** - -.. code-block:: python - - def __init__(self, name) -> None: - self.name = name - + value = str + f"Unknown recived type, got: '{type(value).__name__}'"