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 doesn't remove trailing whitespaces of header docstrings for sphinx-gallery #71

Closed
seisman opened this issue Feb 20, 2021 · 5 comments
Labels
C: style Relates to docstring format style (e.g., Google, NumPy, Sphinx) P: enhancement Feature that is outside the scope of PEP 257
Milestone

Comments

@seisman
Copy link

seisman commented Feb 20, 2021

docformatter can remove trailing whitespaces from the following script:

"""
A docstring with some invisible whitespace.     

More description with some invisible trailing whitespaces.   
"""

but does nothing to sphinx-gallery style header docstrings:

"""
A docstring with some invisible whitespace.     
=================================================

More description with some invisible trailing whitespaces.   
"""
@weibullguy weibullguy added the P: enhancement Feature that is outside the scope of PEP 257 label Jul 24, 2022
@weibullguy weibullguy added the C: style Relates to docstring format style (e.g., Google, NumPy, Sphinx) label Aug 6, 2022
@weibullguy weibullguy added this to the v2.0.0 milestone Jan 23, 2023
@weibullguy
Copy link
Member

@seisman v1.7.2 should now remove this whitespace.

@weibullguy
Copy link
Member

Closed by #220

@seisman
Copy link
Author

seisman commented Jun 8, 2023

Just tried docformatter v1.7.2. It still doesn't remove the trailing whitespaces in the following script:

"""
A docstring with some invisible whitespace.     
=================================================

More description with some invisible trailing whitespaces.   
"""

@weibullguy
Copy link
Member

Here's the diff I'm getting with v1.7.2. It looks like the trailing whitespace is being removed.

--- before//home/drowland/projects/test.py
+++ after//home/drowland/projects/test.py
@@ -1,7 +1,7 @@
 def function_A():
     """
-    A docstring with some invisible whitespace.     
+    A docstring with some invisible whitespace.
     =================================================
 
-    More description with some invisible trailing whitespaces.   
+    More description with some invisible trailing whitespaces.
     """
$ python --version
Python 3.10.8

$ pip list
Package            Version
------------------ -------
charset-normalizer 3.1.0
docformatter       1.7.2
pip                23.1.2
setuptools         67.7.2
untokenize         0.1.1
wheel              0.40.0

@seisman
Copy link
Author

seisman commented Jun 9, 2023

Here are the command I ran which doesn't work for me.

$ conda create --name docformatter172 python=3.10.8
$ conda activate docformatter172
$ conda install docformatter
$ which docformatter
~/opt/miniconda/envs/docformatter172/bin/docformatter
$ docformatter --check --diff test.py  # this command outputs nothing

$ python --version
Python 3.10.8

$ pip list
Package            Version
------------------ -------
charset-normalizer 3.1.0
docformatter       1.7.2
pip                23.1.2
setuptools         67.7.2
untokenize         0.1.1
wheel              0.40.0

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: enhancement Feature that is outside the scope of PEP 257
Projects
None yet
Development

No branches or pull requests

2 participants