Skip to content

Commit 27667f5

Browse files
[no-member doc] Add generated-members documentation (#7949)
Closes #7944
1 parent 62232b3 commit 27667f5

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

doc/data/messages/n/no-member/details.rst

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,9 @@ If you are getting the dreaded ``no-member`` error, there is a possibility that
22
either:
33

44
- pylint found a bug in your code
5-
- You're launching pylint without the dependencies installed in its environment.
6-
- pylint would need to lint a C extension module and is refraining to do so.
5+
- You're launching pylint without the dependencies installed in its environment
6+
- pylint would need to lint a C extension module and is refraining to do so
7+
- pylint does not understand dynamically generated code
78

89
Linting C extension modules is not supported out of the box, especially since
910
pylint has no way to get an AST object out of the extension module.
@@ -27,3 +28,10 @@ build AST objects from all the C extensions that pylint encounters::
2728
Alternatively, since pylint emits a separate error for attributes that cannot be
2829
found in C extensions, ``c-extension-no-member``, you can disable this error for
2930
your project.
31+
32+
If something is generated dynamically, pylint won't be able to understand the code
33+
from your library (c-extension or not). You can then specify generated attributes
34+
with the ``generated-members`` option. For example if ``cv2.LINE_AA`` and
35+
``sphinx.generated_member`` create false positives for ``no-member``, you can do::
36+
37+
$ pylint --generated-member=cv2.LINE_AA,sphinx.generated_member

0 commit comments

Comments
 (0)