Comments (8)
--pre-summary-space
matches the --pre-summary-newline
option for naming, so would probably be the least confusing.
from docformatter.
@ndevenish Made a pull request adding this option. Mind trying it out?
from docformatter.
😮 I have seen extra spaces around a one-line docstring, or extra leading space on the first line of a multiline docstring, but didn’t know there was a style of one-line docstring with leading space but no trailing space.
from docformatter.
Note that black
inserts the leading whitespace. Therefore if you use both black
and docformatter
you'll be in formatting limbo.
See psf/black#2912
from docformatter.
Also worth pointing out https://docs.python.org/3/library/inspect.html#inspect.cleandoc strips this, so it should have no semantic difference (help docs do not have the whitespace).
from docformatter.
Last comment, black
only inserts the leading space if the first character is the quote, so it's obvious there's an extra quote. Otherwise there isn't a leading space.
E.g.
# Adds leading space
""" "I'm quoted"."""
# But also doesn't
"""I'm not quoted."""
So applying the space everywhere would still land you in limbo.
from docformatter.
@thejcannon thanks for pointing this out.
PR #46 is submitted to add the leading space. Once that PR is merged, using the --pre-summary-space
option will maintain the black-inserted space. For those who prefer the non-space formatting they would need to run black first, then docformatter. I've asked the #46 pull requester to address this interaction in the README.
from docformatter.
Closed by #46
from docformatter.
Related Issues (20)
- release: v1.7.4 [Community Feedback] HOT 1
- Wrapping yield tag HOT 2
- release: v1.7.5 [Community Feedback]
- Useless trailing whitespace added
- Requirements table in docs does not actually render
- duplicate content after running docformatter HOT 2
- Inconsistent behavior with :arg syntax HOT 1
- Docformatter not formatting multi-line format of docstring
- ImportError: dlopen(/Users/glennjocher/.cache/pre-commit/repofadve4nf/py_env-python3.11/lib/python3.11/site-packages/charset_normalizer/md.cpython-311-darwin.so, 0x0002) HOT 4
- docformatter omits pyproject.toml configuration when has no extra dependencies installed
- I believe URL_REGEX is missing a `|` HOT 1
- pydocstyle: D202 - Removes blank line after function docstring.
- Incorrect handling of cvar, ivar and vartype tags in sphynx-style HOT 7
- Docstrings containing backticks are not formatted
- Tests fail with Python 3.12 HOT 1
- Bug: not splitting two sentence summary into description
- AttributeError: 'NoneType' object has no attribute 'encoding' (from_path(filename).best().encoding)
- Missing indentation as in example
- docformatter seems to have trouble with linebreaks inside directives in info fields HOT 3
- pre-commit hook usage is wrong in documentation
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from docformatter.