{"id":5399,"library":"pylint-junit","title":"Pylint JUnit Reporter","description":"Pylint plugin that generates JUnit based report that can be consumed by CI environments like Jenkins, Azure DevOps, and similar environments. This project was created to address shortcomings in other tools at the time, specifically around handling 'empty' results (no Pylint issues) and better mapping multiple issues per file. The current version is 0.3.5, last released on January 21, 2025.","status":"active","version":"0.3.5","language":"en","source_language":"en","source_url":"https://github.com/rasjani/pylint_junit","tags":["pylint","junit","ci","reporting","static-analysis","quality-assurance"],"install":[{"cmd":"pip install pylint-junit","lang":"bash","label":"Install with pip"}],"dependencies":[{"reason":"Used to generate the JUnit XML output format.","package":"junit_xml","optional":false}],"imports":[{"note":"This is how the reporter class is invoked via the Pylint command line. It's not a standard Python import in user code.","symbol":"JUnitReporter","correct":"pylint --output-format=pylint_junit.JUnitReporter your_module.py"}],"quickstart":{"code":"import os\n\ndef check_me():\n    x = 1\n    y = 2\n    z = x + y\n    return 'result'\n\n# To run Pylint with the JUnit reporter:\n# 1. Save the above code as 'my_module.py'\n# 2. Run in your terminal:\n#    pip install pylint pylint-junit\n#    pylint --output-format=pylint_junit.JUnitReporter my_module.py > pylint_report.xml\n# 3. View the generated pylint_report.xml file.","lang":"python","description":"This quickstart demonstrates how to run Pylint with the `pylint-junit` plugin to generate a JUnit XML report. The example Python code contains minor Pylint issues (e.g., unused import, missing docstring, unused variable) to ensure the report contains findings. The output is redirected to `pylint_report.xml`."},"warnings":[{"fix":"Ensure you are using `pylint-junit` for reliable JUnit XML generation.","message":"Older or alternative JUnit reporters for Pylint (e.g., `pylint2junit`) sometimes produced invalid XML, especially when no issues were found. `pylint-junit` was developed to specifically address these 'empty result' scenarios, ensuring valid JUnit XML is always generated.","severity":"gotcha","affected_versions":"<0.3.0 (for pylint-junit), potentially all versions of pylint2junit"},{"fix":"Prefer using the `--output-format` command-line argument for granular control over Pylint's output per invocation.","message":"When configuring `pylint-junit` in your `.pylintrc` file using `output-format=junit`, it sets the default output for all Pylint runs. If you sometimes need the standard Pylint output, you should omit this from your `.pylintrc` and instead specify `--output-format=junit` (or `--output-format=pylint_junit.JUnitReporter`) on the command line only when a JUnit report is desired.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Consult the `pylint-junit` GitHub repository for known compatibility issues and ensure both `pylint` and `pylint-junit` are updated to recent, compatible versions.","message":"There have been reported compatibility issues with `pylint-junit` and specific `pylint` versions, particularly `pylint 2.15` and newer at certain points. While the project aims to stay compatible, users experiencing unexpected behavior should check the GitHub issues for known compatibility problems with their specific `pylint` version.","severity":"gotcha","affected_versions":"Potentially Pylint versions >= 2.15 (at time of issue, may be resolved in newer pylint-junit)"}],"env_vars":null,"last_verified":"2026-04-13T00:00:00.000Z","next_check":"2026-07-12T00:00:00.000Z"}