{"id":4006,"library":"flake8-junit-report-basic","title":"Flake8 JUnit Report Basic","description":"flake8-junit-report-basic is a simple Python command-line tool (version 3.0.0) that converts the output from Flake8 static analysis into the JUnit XML format. This conversion facilitates integration with Continuous Integration (CI) systems like Jenkins or CircleCI, allowing them to display Flake8 failures alongside other test results. The project shows recent activity with its 3.0.0 release, though its historical context includes an older, unmaintained fork.","status":"active","version":"3.0.0","language":"en","source_language":"en","source_url":"https://github.com/ricardogarfe/flake8-junit-report","tags":["flake8","junit","report","ci","static analysis","linter"],"install":[{"cmd":"pip install flake8-junit-report-basic","lang":"bash","label":"Install latest version"}],"dependencies":[{"reason":"Required to generate the initial static analysis report which this tool converts.","package":"flake8","optional":false}],"imports":[],"quickstart":{"code":"# 1. Create a dummy Python file with a Flake8 error\nPath('my_module.py').write_text('import os; x = 1  ') # E222, W292\n\n# 2. Run Flake8 and save its output to a file\n# This simulates the output that flake8_junit expects\nresult = subprocess.run(\n    ['flake8', '--output-file', 'flake8_report.txt', 'my_module.py'],\n    capture_output=True, text=True\n)\n\n# 3. Convert the Flake8 output file to JUnit XML format\n# The executable is named 'flake8_junit'\njunit_result = subprocess.run(\n    ['flake8_junit', 'flake8_report.txt', 'junit_report.xml'],\n    capture_output=True, text=True\n)\n\n# Optional: Print the generated JUnit XML content\nprint(Path('junit_report.xml').read_text())","lang":"python","description":"The quickstart demonstrates how to use `flake8-junit-report-basic` by first running `flake8` to generate a text report, and then using the `flake8_junit` command-line utility to convert that report into a JUnit XML file. This JUnit XML file can then be consumed by CI/CD tools. Ensure `flake8` is installed and a `my_module.py` file with some Flake8 issues is present for a meaningful report."},"warnings":[{"fix":"Review and update CI pipeline configurations or XML parsing logic to accommodate the new granular testcase structure in the JUnit report.","message":"Version 3.0.0 introduces a significant change by generating individual testcases for each Flake8 error, rather than one testcase per file. This new output structure for the JUnit XML may break existing CI pipelines or tools that rely on the previous XML format.","severity":"breaking","affected_versions":">=3.0.0"},{"fix":"Always use `flake8_junit` as the command when interacting with the installed package. E.g., `flake8_junit input.txt output.xml`.","message":"The command-line executable provided by the `flake8-junit-report-basic` package is named `flake8_junit`, not `flake8-junit-report-basic`. Users should invoke `flake8_junit` directly after installation.","severity":"gotcha","affected_versions":"All"},{"fix":"Verify the GitHub repository is `https://github.com/ricardogarfe/flake8-junit-report` and that the PyPI package is `flake8-junit-report-basic` to ensure you are using the actively maintained version.","message":"There are older, unmaintained forks (e.g., `initios/flake8-junit-report`) with similar names whose GitHub READMEs display 'WARNING: Not mantained'. Ensure you are referring to the active `ricardogarfe/flake8-junit-report` repository and installing `flake8-junit-report-basic` for the latest version and active development.","severity":"gotcha","affected_versions":"All"}],"env_vars":null,"last_verified":"2026-04-11T00:00:00.000Z","next_check":"2026-07-10T00:00:00.000Z"}