Skip to content

Docstrings containing backticks are not formattedΒ #243

@paduszyk

Description

@paduszyk

Hi! βœ‹πŸ»

The package is great! Thanks a lot for contributing! πŸ₯‡

I have been using it for while and recently noticed that the tool ignores the docstrings containing "backticks" (the ones used e.g. to markup inline code in GitHub markdown).

My configuration (pyproject.toml) is:

[tool.docformatter]
black = true
blank = true
close-quotes-on-newline = true
make-summary-multi-line = true
recursive = true
pre-summary-newline = true

Sample code:

def foo(bar):
    """Return `foo` using `bar`. Description."""

is not formatted (neither via CLI nor pre-commit hook). If I replace backticks to single quotation marks, everything works as expected, namely I get the following diff.:

--- before/./test.py
+++ after/./test.py
@@ -12,4 +12,9 @@
 
 
 def foo(bar):
-    """Return 'foo' using 'bar'. Description."""
+    """
+    Return 'foo' using 'bar'.
+
+    Description.
+
+    """

Any ideas? Thanks! 🀝

Metadata

Metadata

Assignees

No one assigned

    Labels

    C: conventionRelates to docstring format conventionP: bugPEP 257 violation or existing functionality that doesn't work as documentedU: high

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions