black
black copied to clipboard
fix: additional newline added to docstring when the previous line length is less than the line length limit minus 1
Description
This resolves the issue mentioned in issue #4180, where a newline will
be added to a docstring comment (that is approaching the line limit),
even if the docstring contains a newline before the closing quotes.
Checklist - did you ...
- [✓] Add an entry in
CHANGES.mdif necessary? - [✓] Add / update tests if necessary?
- [✓] Add new / update outdated documentation?
diff-shades results comparing this PR (8a421123a7b918489feaf335e2b6f1e25cf7b686) to main (632f44bd68b818cbc9dfd57e7485f0e5c3863b76). The full diff is available in the logs under the "Generate HTML diff report" step.
╭─────────────────────── Summary ────────────────────────╮
│ 5 projects & 9 files changed / 9 changes [+0/-9] │
│ │
│ ... out of 2 530 293 lines, 12 163 files & 22 projects │
╰────────────────────────────────────────────────────────╯
Differences found.
I see that diff-shades detected changes, but they appear to be the intended changes based on the original issue. If there is anything remaining that needs to be done/changed, please let me know and I am happy to do so.