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

Changes to spacing docstrings #1471

Open
Jackenmen opened this issue Jun 1, 2020 · 1 comment
Open

Changes to spacing docstrings #1471

Jackenmen opened this issue Jun 1, 2020 · 1 comment
Labels
F: docstrings How we format docstrings T: bug Something isn't working

Comments

@Jackenmen
Copy link
Contributor

Jackenmen commented Jun 1, 2020

I am actually not too sure if this is an issue of Black, the original docstring is already formatted badly, but just in case this is something that shouldn't happen, I've decided it's better to post it here.

This happens only on master (tested on commit cd3a93a)

Input:

def delete_delay():
    """Currently used for:
        * delete delay"""

def remove_global_rule():
    """Remove a global rule from a command.

    `<cog_or_command>` is the cog or command to remove the rule
    from. This is case sensitive.

   `<who_or_what>` is one or more users, channels or roles the rule is for.
    """

Output:

def delete_delay():
    """Currently used for:
    * delete delay"""


def remove_global_rule():
    """Remove a global rule from a command.

     `<cog_or_command>` is the cog or command to remove the rule
     from. This is case sensitive.

    `<who_or_what>` is one or more users, channels or roles the rule is for.
    """

And since it might be a little hard to notice, here's diff:

--- test.py     2020-06-01 00:37:40.239073 +0000
+++ test.py     2020-06-01 00:37:42.678071 +0000
@@ -1,13 +1,13 @@
 def delete_delay():
     """Currently used for:
-        * delete delay"""
+    * delete delay"""


 def remove_global_rule():
     """Remove a global rule from a command.

-    `<cog_or_command>` is the cog or command to remove the rule
-    from. This is case sensitive.
+     `<cog_or_command>` is the cog or command to remove the rule
+     from. This is case sensitive.

-   `<who_or_what>` is one or more users, channels or roles the rule is for.
+    `<who_or_what>` is one or more users, channels or roles the rule is for.
     """
@ichard26
Copy link
Collaborator

This is probably because of #1053. As you have already mentioned, this doesn't happen on stable since that PR is after the latest release.

Stable

(env) richard-26@ubuntu-laptop:~/programming/bandersnatch$ black ../black/test.py --diff
--- ../black/test.py	2020-06-10 15:42:09.718125 +0000
+++ ../black/test.py	2020-06-10 15:45:33.325073 +0000
@@ -1,8 +1,9 @@
 def delete_delay():
     """Currently used for:
         * delete delay"""
+
 
 def remove_global_rule():
     """Remove a global rule from a command.
 
     `<cog_or_command>` is the cog or command to remove the rule
reformatted ../black/test.py
All done! ✨ 🍰 ✨
1 file reformatted.

@ichard26 ichard26 added F: strings Related to our handling of strings T: bug Something isn't working labels May 16, 2021
@felix-hilden felix-hilden added F: docstrings How we format docstrings and removed F: strings Related to our handling of strings labels Aug 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
F: docstrings How we format docstrings T: bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants