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

fix: add missing package visibility #80

Merged
merged 1 commit into from
Nov 9, 2023

Conversation

stubbfel
Copy link
Contributor

@stubbfel stubbfel commented Nov 9, 2023

Hello today i had following issue, that doxygen create for c# code likes this:

internal class Foo {
 void Do() {
 }
}

xml output like:

...
<compounddef id="classFoo" kind="class" language="C#" prot="package">
..

and the value "package" in the prot element cause an exception during build process:

INFO    -  Start plugin MkDoxy
INFO    -  -> Start project 'PublicApiRef'
INFO    -    -> generating Doxygen files
Traceback (most recent call last):
  File ".venv/bin/mkdocs", line 8, in <module>
    sys.exit(cli())
  File ".venv/lib/python3.9/site-packages/click/core.py", line 1157, in __call__
    return self.main(*args, **kwargs)
  File ".venv/lib/python3.9/site-packages/click/core.py", line 1078, in main
    rv = self.invoke(ctx)
  File ".venv/lib/python3.9/site-packages/click/core.py", line 1688, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File ".venv/lib/python3.9/site-packages/click/core.py", line 1434, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File ".venv/lib/python3.9/site-packages/click/core.py", line 783, in invoke
    return __callback(*args, **kwargs)
  File ".venv/lib/python3.9/site-packages/mkdocs/__main__.py", line 286, in build_command
    build.build(cfg, dirty=not clean)
  File ".venv/lib/python3.9/site-packages/mkdocs/commands/build.py", line 304, in build
    files = config.plugins.on_files(files, config=config)
  File ".venv/lib/python3.9/site-packages/mkdocs/plugins.py", line 533, in on_files
    return self.run_event('files', files, config=config)
  File ".venv/lib/python3.9/site-packages/mkdocs/plugins.py", line 507, in run_event
    result = method(item, **kwargs)
  File ".venv/lib/python3.9/site-packages/mkdoxy/plugin.py", line 126, in on_files
    self.doxygen[project_name] = Doxygen(doxygenRun.getOutputFolder(), parser=parser, cache=cache)
  File ".venv/lib/python3.9/site-packages/mkdoxy/doxygen.py", line 35, in __init__
    node = Node(
  File ".venv/lib/python3.9/site-packages/mkdoxy/node.py", line 53, in __init__
    self._check_for_children()
  File ".venv/lib/python3.9/site-packages/mkdoxy/node.py", line 222, in _check_for_children
    child = Node(None, memberdef, self._cache, self._parser, self)
  File ".venv/lib/python3.9/site-packages/mkdoxy/node.py", line 66, in __init__
    self._check_attrs()
  File ".venv/lib/python3.9/site-packages/mkdoxy/node.py", line 241, in _check_attrs
    self._visibility = Visibility(prot) if prot is not None else Visibility.PUBLIC
  File "/usr/local/lib/python3.9/enum.py", line 384, in __call__
    return cls.__new__(cls, value)
  File "/usr/local/lib/python3.9/enum.py", line 702, in __new__
    raise ve_exc
ValueError: 'package' is not a valid Visibility

by adding the package value to the Visibility enum, the exception did no longer appears.

@JakubAndrysek JakubAndrysek merged commit d4c5ef7 into JakubAndrysek:main Nov 9, 2023
8 checks passed
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

Successfully merging this pull request may close these issues.

None yet

2 participants