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

Add property reformatting #56

Merged
merged 2 commits into from
Apr 3, 2021

Conversation

jaydcarlson
Copy link

Doxygen gets confused by Python properties; this PR works around this issue by rewriting the property's definition in a manner that Doxygen understands.

After applying this patch, doxypypy will transform this:

@property
def enabled(self) -> bool:
    """
    Gets or sets whether the module is enabled

    Returns:
        whether the module is enabled
    """
    return self._enabled

@enabled.setter
def enabled(self, value: bool):
    self._enabled = value

into this:

## @brief   Gets or sets whether the module is enabled
#
# @return
# @return   whether the module is enabled
#
#

enabled = property
## \private
@property
def enabled(self) -> bool:
    return self._enabled

## \private
@enabled.setter
def enabled(self, val: bool):
    self._enabled = value

We create a new property that will contain the correct docstring; we then use \private to hide the existing getter/setter from doxygen.

Closes #18.

@Feneric
Copy link
Owner

Feneric commented Apr 20, 2018

I'd be happy to add this, but we need some tests for it. All the major features of doxypypy are presently covered by tests in the test folder, and all of these tests get run prior to each release. We don't want to go down the path of adding in new features that'll silently break later, because that won't help anybody.

martin-chatterjee added a commit to martin-chatterjee/doxypypy that referenced this pull request Jun 19, 2020
@Feneric Feneric merged commit 06da1df into Feneric:master Apr 3, 2021
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.

Class @property
2 participants