A visualizer for LLVM's linting tool: clang-tidy.
These instructions will get you a copy of the project up and running on your local machine.
Install Clang-Tidy to use for your C/C++ source files.
On your local Linux machine, installation is as easy as:
sudo apt install clang-tidy
You will need bash or some other terminal to execute the script. Download Python 3 or higher here.
When running clang-tidy on your files, be sure to pipe it into a new log file of checks:
clang-tidy -checks=* [filename.c] | tee [newfile.log]
If you are receiving the following error:
Error while trying to load a compilation database: Could not auto-detect compilation database for file "your_file.c" No compilation database found in /your/directory or any parent directory
Create a simple json file to be compiled into your project documented here.
Clone or fork this repository to run the script on your native system.
The script takes in one file argument of a txt or log file with your outputted clang-tidy checks.
python3 clang_visualizer.py [newfile.log]
Inside the same directory as clang_visualizer.py, you will find a new html file called 'clang.html'.
An example html output can be found here.
A separate example with the external link option as a button can be found here.
The highlighting functionality uses your local session storage, which will save your changes on exit.
Feel free to create a pull request for any updates or fixes to this repository.
This repository uses LLVM Clang for versioning. All checks confirmed for version 6.0-8.0. Earlier versions should have support for the vast majority of checks.
- Austin Hale
See also the list of contributors who participated in this project.
This project is licensed under the MIT License - see the LICENSE file for details.