Registry / testing / pylint-junit

pylint-junit

JSON →
library0.3.5pypypi✓ verified 24d ago

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.

pip install pylint-junit
INSTALL
IMPORT
SIG · PYLINT-JUNIT
P
pylint-junit
testingpythonv0.3.5
Install
3.0s avg
Import
Disk
29MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v0.3.5 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.95 runs
installs and imports cleanly · install 0.0s · import 0.000s · 31.5MB
glibc
py 3.103.95 runs
installs and imports cleanly · install 3.0s · import 0.000s · 32MB
29MB installed
● package 29MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

JUnitReporter
pylint --output-format=pylint_junit.JUnitReporter your_module.py
This is how the reporter class is invoked via the Pylint command line. It's not a standard Python import in user code.

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`.

import os def check_me(): x = 1 y = 2 z = x + y return 'result' # To run Pylint with the JUnit reporter: # 1. Save the above code as 'my_module.py' # 2. Run in your terminal: # pip install pylint pylint-junit # pylint --output-format=pylint_junit.JUnitReporter my_module.py > pylint_report.xml # 3. View the generated pylint_report.xml file.
Debug
Known issues
gotchaOlder 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.
fix
Ensure you are using `pylint-junit` for reliable JUnit XML generation.
affects: <0.3.0 (for pylint-junit), potentially all versions of pylint2junit
gotchaWhen 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.
fix
Prefer using the `--output-format` command-line argument for granular control over Pylint's output per invocation.
affects: All versions
gotchaThere 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.
fix
Consult the `pylint-junit` GitHub repository for known compatibility issues and ensure both `pylint` and `pylint-junit` are updated to recent, compatible versions.
affects: Potentially Pylint versions >= 2.15 (at time of issue, may be resolved in newer pylint-junit)
Upgrade
Version history
0.3.5latest on PyPI · released Jan 21, 2025
Audit
Dependencies
junit_xmlrequiredUsed to generate the JUnit XML output format.
Agent activity
7 hits · last 30 days
node
6
Resources
pylint-junit — pip install pylint-junit · libregistry