DOCFORMATTER(1)

✨ NAME ✨

docformatter β€” okay bestie, it Formats docstrings to follow Python PEP 257 (Documentation) πŸ’– that's literally the whole job and she does it flawlessly.


πŸŽ€ DESCRIPTION πŸŽ€

So you run it like this:

usage: docformatter [-h] [-i | -c] [-d] [-r] [-e [EXCLUDE ...]]
       [-n [NON-CAP ...]] [-s [style]] [--rest-section-adorns REGEX]
              [--black] [--wrap-summaries length] [--wrap-descriptions length]
              [--force-wrap] [--tab-width width] [--blank]
              [--pre-summary-newline] [--pre-summary-space]
              [--make-summary-multi-line] [--close-quotes-on-newline] [--range
              line line] [--docstring-length length length] [--non-strict]
              [--config CONFIG] [--version] files [files ...]

Periodt. Now let's get into it πŸ‘‘


🌸 positional arguments: 🌸

  • files β€” the files you wanna format, or '-' if you're feeding it from standard in 🫢

πŸ’… options: πŸ’…

  • -h, --help β€” shows this help message and dips (exit) ✨
  • -i, --in-place β€” actually edits your files instead of just printing diffs. main character move, no cap πŸ”₯
  • -c, --check β€” only checks and reports back which files are formatted wrong. snitch mode but make it helpful πŸ’€
  • -d, --diff β€” when you use it together with --check or --in-place, it also says what changes would be made πŸ‘€
  • -r, --recursive β€” drills down directories recursively, she goes deep πŸ¦‹
  • -e [EXCLUDE ...], --exclude [EXCLUDE ...] β€” in recursive mode, exclude directories and files by names πŸ™ˆ
  • -n [NON-CAP ...], --non-cap [NON-CAP ...] β€” gives her a list of words NOT to capitalize when they show up as the first word in the summary πŸ’œ
  • -s style, --style style β€” the docstring style to use when formatting parameter lists. One of epytext, sphinx. (default: sphinx) πŸŽ€
  • --rest-section-adorns REGEX β€” regular expression for identifying reST section adornments (default: [!"#$%&'()*+,-./\:;<=>?@[]^_{|}~]{4,}`) ⭐
  • --black β€” makes formatting compatible with standard black options (default: False) πŸ–€
  • --wrap-summaries length β€” wrap those long summary lines at this length; set it to 0 to disable wrapping entirely (default: 79, 88 with the --black option) ✨
  • --wrap-descriptions length β€” wraps descriptions at this length; set to 0 to disable wrapping (default: 72, 88 with the --black option) πŸŽ€
  • --force-wrap β€” forces descriptions to be wrapped even if it may result in a mess. brutal honesty from her (default: False) πŸ’€
  • --tab-width width β€” tabs in indentation count as this many characters when wrapping lines (default: 1) 🌈
  • --blank β€” adds a blank line after the description (default: False) πŸ’–
  • --pre-summary-newline β€” adds a newline before the summary of a multi-line docstring (default: False) πŸ¦‹
  • --pre-summary-space β€” adds a space after the opening triple quotes (default: False) 🌸
  • --make-summary-multi-line β€” adds a newline before AND after the summary of a one-line docstring (default: False) 😭
  • --close-quotes-on-newline β€” places the closing triple quotes on a new line when a one-line docstring wraps to two or more lines (default: False) ✨
  • --range line line β€” applies docformatter to docstrings between these lines; line numbers are indexed at 1 (default: None) πŸ‘‘
  • --docstring-length length length β€” applies docformatter to docstrings within the given length range (default: None) πŸ’œ
  • --non-strict β€” don't strictly follow reST syntax to identify lists (see issue #67) (default: False) πŸ™ˆ
  • --config CONFIG β€” path to the file containing docformatter options πŸŽ€
  • --version β€” show the program's version number and exit πŸ’…
okay quick vibe check fr fr: --force-wrap literally warns you it "may result in a mess" so don't come for her if it's messy 😭

That's the whole page bestie, slay πŸ’–βœ¨

This was docformatter 1.7.8, from April 2026, and yeah she's an icon in the DOCFORMATTER(1) manual, iykyk 🫢🌸

πŸ“¦ where this page comes from