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

Unknown node type option_list error when using definitions starting with hypen - #33

Open
julian-poidevin opened this issue Jul 21, 2023 · 0 comments

Comments

@julian-poidevin
Copy link

Using the following code syntax :

This scripts requires two arguments :

-d
    The disk where to create the image (e.g: ``sda``)

-i
    The image name (e.g: ``iecharge-image-comboard.wic``)

And running rstfmt on my source folder using rstfmt source, I'm having the following error :

Traceback (most recent call last):
  File "/workspaces/comboard-linux-image/docs/.venv/lib/python3.8/site-packages/rstfmt/rstfmt.py", line 733, in fmt
    func = getattr(Formatters, type(node).__name__)
AttributeError: type object 'Formatters' has no attribute 'option_list'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/workspaces/comboard-linux-image/docs/.venv/bin/rstfmt", line 8, in <module>
    sys.exit(main())
  File "/workspaces/comboard-linux-image/docs/.venv/lib/python3.8/site-packages/rstfmt/__main__.py", line 97, in main
    do_file(args, f, misformatted)
  File "/workspaces/comboard-linux-image/docs/.venv/lib/python3.8/site-packages/rstfmt/__main__.py", line 44, in do_file
    output = rstfmt.format_node(args.width, doc)
  File "/workspaces/comboard-linux-image/docs/.venv/lib/python3.8/site-packages/rstfmt/rstfmt.py", line 742, in format_node
    ret = "\n".join(fmt(node, FormatContext(0, width, "", "", [], 0)))
  File "/workspaces/comboard-linux-image/docs/.venv/lib/python3.8/site-packages/rstfmt/rstfmt.py", line 488, in document
    yield from chain_intersperse("", fmt_children(node, ctx))
  File "/workspaces/comboard-linux-image/docs/.venv/lib/python3.8/site-packages/rstfmt/rstfmt.py", line 75, in chain_intersperse
    yield from x
  File "/workspaces/comboard-linux-image/docs/.venv/lib/python3.8/site-packages/rstfmt/rstfmt.py", line 484, in section
    yield from chain_intersperse("", fmt_children(node, ctx.in_section()))
  File "/workspaces/comboard-linux-image/docs/.venv/lib/python3.8/site-packages/rstfmt/rstfmt.py", line 75, in chain_intersperse
    yield from x
  File "/workspaces/comboard-linux-image/docs/.venv/lib/python3.8/site-packages/rstfmt/rstfmt.py", line 484, in section
    yield from chain_intersperse("", fmt_children(node, ctx.in_section()))
  File "/workspaces/comboard-linux-image/docs/.venv/lib/python3.8/site-packages/rstfmt/rstfmt.py", line 71, in chain_intersperse
    for x in it:
  File "/workspaces/comboard-linux-image/docs/.venv/lib/python3.8/site-packages/rstfmt/rstfmt.py", line 209, in <genexpr>
    return (fmt(c, ctx) for c in node.children)
  File "/workspaces/comboard-linux-image/docs/.venv/lib/python3.8/site-packages/rstfmt/rstfmt.py", line 735, in fmt
    raise ValueError(f"Unknown node type {type(node).__name__}!")
ValueError: Unknown node type option_list!

Putting -d and -i in between ticks solves the issue :

``-d``
   The disk where to create the image (e.g: ``sda``)

``-i``
   The image name (e.g: ``iecharge-image-comboard.wic``)

  • rstfmt version : rstfmt 0.0.13
  • python3 version : Python 3.8.10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant