Skip to content

Regression on master: Extra newlines added #326

@adamtheturtle

Description

@adamtheturtle

Create example.py:

"""My docstring."""

On master docformatter adds newlines here.

I narrowed this down to commit e239dca.
The example below shows that with 1b3f03d there are no changes to the file, but with e239dca, docformatter adds a newline.
I chose Python 3.11 but this applies to other Python versions.

adam@Adams-MacBook-Pro ~/D/f/docformatter ((1b3f03d3))> git checkout 1b3f03d334d9c1322ccaa02b655aedadc150d9d3
HEAD is now at 1b3f03d fix: issue 321 (#323)
adam@Adams-MacBook-Pro ~/D/f/docformatter ((1b3f03d3))> uv run --python=3.11 --with=. docformatter  example.py
warning: No `requires-python` value found in the workspace. Defaulting to `>=3.11`.
adam@Adams-MacBook-Pro ~/D/f/docformatter ((1b3f03d3))> git checkout e239dca9a26cd46c4d0a37d5f050a23fe90b4f4e
Previous HEAD position was 1b3f03d fix: issue 321 (#323)
HEAD is now at e239dca Remove external untokenize package. Use tokenize from the Python standard library. (#325)
adam@Adams-MacBook-Pro ~/D/f/docformatter ((e239dca9))> uv run --python=3.11 --with=. docformatter  example.py
warning: No `requires-python` value found in the workspace. Defaulting to `>=3.11`.
--- before/example.py
+++ after/example.py
@@ -1 +1,3 @@
 """My docstring."""
+
+

Metadata

Metadata

Assignees

No one assigned

    Labels

    freshThis is a new issue

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions