Steps to reproduce
- Pylint configured to load a module which contains a C extension ie. Pygame, and report in JSON
[MASTER]
extension-pkg-whitelist=pygame
...
[REPORTS]
output-format=json
- Run Pylint on a file which contains a call to the method containing a C extension.
import pygame
if __name__ == "__main__":
pygame.init()
pylint main.py > output.json
- Cat the output and the result should look as follows:
pygame 1.9.6
Hello from the pygame community. https://www.pygame.org/contribute.html
[
{
"type": "convention",
"module": "settings",
"obj": "",
"line": 1,
"column": 0,
"path": "src/games/space_invaders/settings.py",
"symbol": "missing-module-docstring",
"message": "Missing module docstring",
"message-id": "C0114"
},
...
Current behavior
Currently Pylint is not suppressing messages written to the stdout of C extensions which get loaded. This results in a report generation which does not follow the json formatting, as it contains anything which may be printed to the stdout by a C extension during analysis.
Expected behavior
Pylint shouldn't print the stdout messages of C extensions being ran during analysis.
ie the report.json should look as follows:
[
{
"type": "convention",
"module": "settings",
"obj": "",
"line": 1,
"column": 0,
"path": "src/games/space_invaders/settings.py",
"symbol": "missing-module-docstring",
"message": "Missing module docstring",
"message-id": "C0114"
},
...
pylint --version output
circleci@b0feadac759a:~$ pylint --version
pylint 2.4.4
astroid 2.3.3
Python 3.6.10 (default, Apr 21 2020, 14:40:51)
[GCC 8.3.0]
Steps to reproduce
pylint main.py > output.jsonCurrent behavior
Currently Pylint is not suppressing messages written to the stdout of C extensions which get loaded. This results in a report generation which does not follow the json formatting, as it contains anything which may be printed to the stdout by a C extension during analysis.
Expected behavior
Pylint shouldn't print the stdout messages of C extensions being ran during analysis.
ie the
report.jsonshould look as follows:[ { "type": "convention", "module": "settings", "obj": "", "line": 1, "column": 0, "path": "src/games/space_invaders/settings.py", "symbol": "missing-module-docstring", "message": "Missing module docstring", "message-id": "C0114" }, ...pylint --version output
circleci@b0feadac759a:~$ pylint --version pylint 2.4.4 astroid 2.3.3 Python 3.6.10 (default, Apr 21 2020, 14:40:51) [GCC 8.3.0]