docformatter icon indicating copy to clipboard operation
docformatter copied to clipboard

Ignoring specific line

Open ethiy opened this issue 2 years ago • 1 comments

In my project doctstrings, I have some sphinx style notes. In consequence, I have a line break just after .. note:: as shown hereafter:

def foo():
  """
  Fancy doc
  
  More details.

  .. note::
    Some notes.
  """
  pass

However, when I run docformatter with these options r -i --pre-summary-newline --make-summary-multi-line --wrap-summaries 90 --wrap-descriptions 90 it outputs:

def foo():
  """
  Fancy doc
  
  More details.

  .. note::  Some notes.
  """
  pass

even when I exclude the affected files.

Is there a way to ignore specific lines?

ethiy avatar Feb 22 '22 14:02 ethiy

There is no way to ignore specific lines at the moment. The issue with Sphinx directives will be addressed with #60.

weibullguy avatar Jul 29 '22 02:07 weibullguy

+1 on specific line ignores! I want to add this to the Astropy CI, but the option to ignore specific lines — e..g. by docfmt: +SKIP or noqa: DOC101 or something — is a must to support some of our runtime docstring processing.

nstarman avatar Jan 11 '23 16:01 nstarman

The specific problem that was reported actually has to do with handing reST directives. There are any number of other issues related to reST directives. The requested solution (and the +1) is essentially the same as #144, so I'm going to close this issue to #144.

weibullguy avatar Jan 11 '23 21:01 weibullguy