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

Python private class incorrectly expects documentation for its methods #10235

Closed
lelegard opened this issue Aug 16, 2023 · 7 comments
Closed

Comments

@lelegard
Copy link

Hi,

With the current state of the repo (1.9.8), when private elements are not documented, doxygen still requires documentation for the components of a Python private class.

Example test.py:

# Private class, undocumented
class __C1:
    # Method of an undocumented class, shall not be documented
    def test(self):
        # Field of an undocumented class, shall not be documented
        self.a = None

## Public class, documented
class C2:
    ## Public method of a documented class
    def test(self):
        pass

Output:

$ ../doxygen-master/build/bin/doxygen
test.py:4: warning: Member test(self) (function) of class test::__C1 is not documented.
test.py:6: warning: Member a (variable) of class test::__C1 is not documented.
$ ../doxygen-master/build/bin/doxygen --version
1.9.8 (a996a63a5a7527b29117737db60019ade81d7fa7)

Set of files to reproduce: doxybug3.zip

Doxygen does not complain that the private class __C1 is not documented. However, it complains that the method and fields of the private class are not documented.

It does not make sense to document fields of something which is not documented. When documentation is not required for private elements, the resulting documentation is for the user of the module. Everything that is not accessible to the user (such as elements of private classes) shall not need documentation either.

See #10231 for a discussion on private identifiers.

Additional minor anomaly, the class name is designated as test::__C1 in the error message. This is a C++ notation. Since the class is a Python one, it should be named as test.__C1.

albert-github added a commit to albert-github/doxygen that referenced this issue Aug 16, 2023
Setting correct separator in identified warnings for C#.
@albert-github
Copy link
Collaborator

Regarding the minor issue with the :: versus . in the warning I've just pushed a proposed patch, pull request #10236
(Note: there might be other places as well that have not yet been identified).

albert-github added a commit to albert-github/doxygen that referenced this issue Aug 16, 2023
…ation for its methods

Apply private / protected logic also to classes
@albert-github
Copy link
Collaborator

Regarding the main problem: I've just pushed a proposed patch, pull request #10237

@lelegard
Copy link
Author

Thanks @albert-github

What about the status of private fields in general, as discussed in #10231? First, it breaks lots of code which use the traditional single-underscore convention for private fields. Second, using the demangled syntax to access double-underscore private fields generates an error.

doxygen added a commit that referenced this issue Aug 18, 2023
@albert-github
Copy link
Collaborator

Code of #10236 (minor issue with the :: versus .) has been integrated in master on GitHub (please don't close the issue as this will be done at the moment of an official release).

albert-github added a commit to albert-github/doxygen that referenced this issue Aug 18, 2023
…ation for its methods

After review, typos corrected
doxygen added a commit that referenced this issue Aug 18, 2023
issue #10235 Python private class incorrectly expects documentation for its methods
@albert-github
Copy link
Collaborator

Code of #10276 (main problem) has been integrated in master on GitHub (please don't close the issue as this will be done at the moment of an official release).

@albert-github albert-github added the fixed but not released Bug is fixed in github, but still needs to make its way to an official release label Aug 18, 2023
@doxygen
Copy link
Owner

doxygen commented Aug 25, 2023

This issue was previously marked 'fixed but not released',
which means it should be fixed in doxygen version 1.9.8.
Please verify if this is indeed the case. Reopen the
issue if you think it is not fixed and please include any additional information
that you think can be relevant (preferably in the form of a self-contained example).

1 similar comment
@doxygen
Copy link
Owner

doxygen commented Aug 25, 2023

This issue was previously marked 'fixed but not released',
which means it should be fixed in doxygen version 1.9.8.
Please verify if this is indeed the case. Reopen the
issue if you think it is not fixed and please include any additional information
that you think can be relevant (preferably in the form of a self-contained example).

@doxygen doxygen removed the fixed but not released Bug is fixed in github, but still needs to make its way to an official release label Aug 25, 2023
@doxygen doxygen closed this as completed Aug 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants
@doxygen @albert-github @lelegard and others