A Python program to generate JUnit XML test result from Linux script checkpatch.pl output.
Then, this result can be consumed by continuous integration tools (Jenkins, GitLab CI ...) to provide nice information display.
pip install checkpatch-junit
git clone https://github.com/mastiggia/checkpatch-junit
python setup.py install
checkpatch-junit [-h] [-V] [-c checkpatch.pl] [--checkpatch-args arg1,arg2,...]
[-o outfile.xml] [--ignore-check] [--ignore-warning]
FILE [FILE ...]
Provide JUnit output to Linux checkpatch.pl script
positional arguments:
FILE patch to analyze with checkpatch.pl
options:
-h, --help show this help message and exit
-V, --version show program's version number and exit
-c checkpatch.pl path to the checkpatch.pl script to use
--checkpatch-args arg1,arg2,...
extra arguments to pass to checkpatch.pl, separated by
commas instead of spaces
-o outfile.xml output JUnit XML file
--ignore-check ignore checkpatch.pl check messages
--ignore-warning ignore checkpatch.pl warning messages
Basic example:
checkpatch-junit -c scripts/checkpatch.pl --checkpatch-args=--no-tree *.patch -o checkpatch.xml
The following screenshot shows a GitLab merge request which fixes 2 patches:
A development environment, using virtual environment, can be prepared with the following commands:
python3 -m venv .venv
source .venv/bin/activate
pip install -r requirements-dev.txt
pre-commit install
pip install -e .