Skip to content

docformatter seems to have trouble with linebreaks inside directives in info fields #279

@xmo-odoo

Description

@xmo-odoo

Saw this issue in PyGithub docstrings, when I fix it docformatter complains about exactly what I'm fixing:

diff --git a/github/Repository.py b/github/Repository.py
index f274973..52bcc11 100644
--- a/github/Repository.py
+++ b/github/Repository.py
@@ -2388,7 +2388,7 @@ class Repository(CompletableGithubObject):
         Create a file in this repository.
 
         :calls: `PUT /repos/{owner}/{repo}/contents/{path} <https://docs.github.com/en/rest/reference/repos#create-or-
-            update-file-contents>`_
+        update-file-contents>`_
         :param path: string, (required), path of the file in the repository
         :param message: string, (required), commit message
         :param content: string, (required), the actual data in the file
@@ -2470,7 +2470,7 @@ class Repository(CompletableGithubObject):
         This method updates a file in a repository.
 
         :calls: `PUT /repos/{owner}/{repo}/contents/{path} <https://docs.github.com/en/rest/reference/repos#create-or-
-            update-file-contents>`_
+        update-file-contents>`_
         :param path: string, Required. The content path.
         :param message: string, Required. The commit message.
         :param content: string, Required. The updated file content, either base64 encoded, or 

Trying to remove the linebreak instead of indenting it also makes docformatter amgy:

diff --git a/github/Repository.py b/github/Repository.py
index d7e3c19..52bcc11 100644
--- a/github/Repository.py
+++ b/github/Repository.py
@@ -2387,7 +2387,8 @@ class Repository(CompletableGithubObject):
         """
         Create a file in this repository.
 
-        :calls: `PUT /repos/{owner}/{repo}/contents/{path} <https://docs.github.com/en/rest/reference/repos#create-or-update-file-contents>`_
+        :calls: `PUT /repos/{owner}/{repo}/contents/{path} <https://docs.github.com/en/rest/reference/repos#create-or-
+        update-file-contents>`_
         :param path: string, (required), path of the file in the repository
         :param message: string, (required), commit message
         :param content: string, (required), the actual data in the file
@@ -2468,7 +2469,8 @@ class Repository(CompletableGithubObject):
         """
         This method updates a file in a repository.
 
-        :calls: `PUT /repos/{owner}/{repo}/contents/{path} <https://docs.github.com/en/rest/reference/repos#create-or-update-file-contents>`_
+        :calls: `PUT /repos/{owner}/{repo}/contents/{path} <https://docs.github.com/en/rest/reference/repos#create-or-
+        update-file-contents>`_
         :param path: string, Required. The content path.
         :param message: string, Required. The commit message.
         :param content: string, Required. The updated file content, either base64 encoded, or ready to be encoded.

Metadata

Metadata

Assignees

No one assigned

    Labels

    C: stakeholderRelates to docformatter stakeholder requested behaviorP: enhancementFeature that is outside the scope of PEP 257U: lowA relatively low urgency issue

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions