Skip to content

Commit

Permalink
cli: remove --compat for hawkmoth.util.doccompat based docstring proc…
Browse files Browse the repository at this point in the history
…essing

The hawkmoth.util.doccompat module has been deprecated. Remove the
--compat option and the dependency on the module.

The alternative is to use the --process-docstring option. It does lack
the kernel-doc support, but it was simplistic to begin with.
  • Loading branch information
jnikula committed Aug 31, 2024
1 parent e143452 commit 7da8f82
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 15 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,12 @@ Deprecated
and ``hawkmoth.ext.napoleon`` extensions and the
``hawkmoth-process-docstring`` event.

Removed
~~~~~~~

* ``hawkmoth --compat={none,javadoc-basic,javadoc-liberal,kernel-doc}`` option
from CLI

Hawkmoth `0.18.0`_
------------------

Expand Down
16 changes: 1 addition & 15 deletions src/hawkmoth/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
from hawkmoth.ext import javadoc
from hawkmoth.ext import napoleon
from hawkmoth.parser import parse
from hawkmoth.util import doccompat

def filename(file):
if os.path.isfile(file):
Expand All @@ -31,11 +30,6 @@ def _process_docstring(transform, lines):
if fn:
fn(lines)

def _process_docstring_compat(args, lines):
text = '\n'.join(lines)
text = doccompat.convert(text, transform=args.compat)
lines[:] = [line for line in text.splitlines()]

def _read_version():
try:
with open(os.path.join(os.path.abspath(os.path.dirname(__file__)),
Expand Down Expand Up @@ -64,14 +58,6 @@ def main():
'napoleon',
],
help='Process docstring.')
compat.add_argument('--compat',
choices=[
'none',
'javadoc-basic',
'javadoc-liberal',
'kernel-doc'
],
help='Compatibility options. See cautodoc_compat.')
parser.add_argument('--clang', metavar='PARAM', action='append',
help='Argument to pass to Clang. May be specified multiple times. See cautodoc_clang.') # noqa: E501
parser.add_argument('--verbose', dest='verbose', action='store_true',
Expand All @@ -86,7 +72,7 @@ def main():
if args.process_docstring:
def process_docstring(lines): return _process_docstring(args.process_docstring, lines)
else:
def process_docstring(lines): return _process_docstring_compat(args, lines)
process_docstring = None

for comment in comments.walk():
if args.verbose:
Expand Down

0 comments on commit 7da8f82

Please sign in to comment.