PyCQA / PyCQA/docformatter

docformatter-v1.7.8 mangles r-strings

Open
#343 3 comments 5 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

C: convention P: bug U: high
Dominant language
Python
Stars
598
Forks
93
PR merge metrics
No merged PRs in 30d

Description

Turns out docformatter-v1.7.8 mangles r-strings in a way that alters the semantics of the program. I had to revert back to v1.7.7 as it doesn't change these r-strings.

Example:

def foo(self) -> str:
    """Returns bash that locates a usable SSH identity and defines `good_ssh`."""
    return r"""
        identity_file=""
        for candidate in "$HOME"/.ssh/id_ed25519 "$HOME"/.ssh/id_rsa "$HOME"/.ssh/id_ecdsa "$HOME"/.ssh/id_dsa; do
        ...
    """

In case it's of any help, complete example is here: https://github.com/whoschek/bzfs/blob/0ce658cc65bac47cb9384ad83f5f54dd9aa6bf0e/bzfs_tests/itest/test_lima_vm_sh.py#L431-L464

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the report with the provided docstring and compare docformatter-v1.7.8 against v1.7.7. Use the complete example in bzfs_tests/itest/test_lima_vm_sh.py at lines 431-464 as the reference; done means r-strings are formatted without changing their program semantics.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.