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

docformatter 1.7.5 improperly breaks on emoji/formatted multiline string #282

Open
hemanthkini opened this issue Jun 11, 2024 · 0 comments
Labels
C: style Relates to docstring format style (e.g., Google, NumPy, Sphinx) P: bug PEP 257 violation or existing functionality that doesn't work as documented U: medium A relatively medium urgency issue

Comments

@hemanthkini
Copy link

Running docformatter 1.7.5 with Python 3.12.4 against this test file:

def test(test_arg1):
    content = f"""
    <table style="width: 100%; height: 100%; font-size: 1.1em;">
        <tr>
            <td style="width: 100%; height: 100%;">🔗 This is a test {test_arg1} </td>
        </tr>
    </table>
    """
    return content

improperly returns:

--- before/test.py
+++ after/test.py
@@ -2,7 +2,7 @@
     content = f"""
     <table style="width: 100%; height: 100%; font-size: 1.1em;">
         <tr>
-            <td style="width: 100%; height: 100%;">🔗 This is a test {test_arg1} </td>
+            <td style="width: 100%; height: 100%;">🔗 This is a test {te{test_arg1} </td>
         </tr>
     </table>
     """

This used to work with Python 3.12.2 - I suspect it's a combination of the use of an emoji, the variable within the curly brace, and some change in the tokenizer/untokenizer logic.

@github-actions github-actions bot added the fresh This is a new issue label Jun 11, 2024
@hemanthkini hemanthkini changed the title docformatter improperly breaks on docformatter 1.7.5 improperly breaks on emoji/formatted multiline string Jun 11, 2024
@weibullguy weibullguy added P: bug PEP 257 violation or existing functionality that doesn't work as documented C: style Relates to docstring format style (e.g., Google, NumPy, Sphinx) and removed fresh This is a new issue labels Jul 31, 2024
@github-actions github-actions bot added the U: medium A relatively medium urgency issue label Jul 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C: style Relates to docstring format style (e.g., Google, NumPy, Sphinx) P: bug PEP 257 violation or existing functionality that doesn't work as documented U: medium A relatively medium urgency issue
Projects
None yet
Development

No branches or pull requests

2 participants