pylint-json2html is a Python utility that transforms Pylint's JSON report output into a human-readable HTML document. This library addresses the removal of native HTML output from Pylint since version 1.7. It provides a simple command-line interface to generate presentable code quality reports. The current version is 0.5.0, with releases occurring as needed rather than on a fixed cadence.
pip install pylint-json2htmlNo compatibility data collected yet for this library.
This quickstart demonstrates the typical workflow: first, run Pylint on your code, ensuring its output format is set to JSON. Then, pipe this JSON output to `pylint-json2html`, redirecting its HTML output to a specified file. Alternatively, Pylint's output can be saved to a file and passed as an argument to `pylint-json2html`.
Install `pylint-json2html` and pipe Pylint's JSON output to it, or use a similar third-party tool.
Ensure Pylint is run with `--output-format=json` or `--output-format=jsonextended` (for more data) when generating input for `pylint-json2html`. For example: `pylint your_module.py --output-format=json | pylint-json2html -o report.html`.
Explicitly set the output encoding using the `-e utf-8` flag for `pylint-json2html` and ensure your terminal/environment handles UTF-8 correctly. Also, consider setting Python's `PYTHONIOENCODING=utf-8` environment variable if piping issues persist.
If you need score or metrics in your HTML report, configure Pylint to output `jsonextended` (e.g., via a custom plugin or Pylint's `--output-format` if it supports it in newer versions, or use the tool's plugin capabilities if applicable) and then run `pylint-json2html -f jsonextended ...`.
Pylint no longer supports direct HTML output. Instead, generate JSON output (`--output-format=json`) and pipe it to `pylint-json2html`. Example: `pylint my_module.py --output-format=json | pylint-json2html -o report.html`.
Verify that Pylint is configured to output JSON (`--output-format=json`) and that its output is successfully piped to `pylint-json2html` (e.g., check for errors in the Pylint command itself). Make sure to pass the output file with `-o <filename>.html`.
Run `pylint-json2html` with the output encoding flag: `pylint ... | pylint-json2html -o report.html -e utf-8`. Also, ensure your terminal supports UTF-8, and consider setting `PYTHONIOENCODING=utf-8`.
Ensure you either pipe Pylint's JSON output directly to `pylint-json2html` or provide a JSON filename as a positional argument. Correct usage: `pylint my_file.py --output-format=json | pylint-json2html -o report.html` OR `pylint my_file.py --output-format=json > report.json; pylint-json2html report.json -o report.html`.