Skip to content

Instantly share code, notes, and snippets.

@blockspacer
Forked from pmoulon/OCLINT
Created June 5, 2020 08:39
Show Gist options
  • Save blockspacer/4c50a439844387dc936d806f1e7a7168 to your computer and use it in GitHub Desktop.
Save blockspacer/4c50a439844387dc936d806f1e7a7168 to your computer and use it in GitHub Desktop.
Using oclint
* Things that can catch OCLINT *
http://oclint-docs.readthedocs.io/en/stable/rules/index.html
*How to install it:*
$ brew tap oclint/formulae
$ brew install oclint
*How to run it:*
1. Run CMAKE export command (export compiler properties per file)
$ cmake -DCMAKE_EXPORT_COMPILE_COMMANDS=ON
=> a file compile_commands.json is created,
Copy it to the main source directory (path where you ran cmake on)
2. Run oclint
$ cd YOUR_SOURCE_PATH
$ oclint-json-compilation-database
The report appears in the shell
You can build more complex output
$ oclint-json-compilation-database -enable-clang-static-analyzer
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment