A wrapper for cppcheck to simplify cppcheck integration. This program exists to provide a way to configure how to run cppcheck on a single file, that can be shared between editor plugins. The log file also provides additional information that plugins may be lacking.
mkdir build && cd build
cmake ..
makebazel build //:run-cppcheckThe compiled binary will be located at bazel-bin/run-cppcheck.
run-cppcheck <file>The configuration file is written in json, as run-cppcheck-config.json. It is searched for recursively in parent directories of the analyzed file.
- project_file: a path to a project file accepted by the cppcheck option --project=.... If the path is relative, it's interpreted as relative to the configuration file.
- cppcheck: cppcheck command.
- log_file: Path to log file. The default log file location is
$XDG_STATE_HOME/run-cppcheckor$HOME/.local/state/run-cppcheckon Linux, and%LOCALAPPDATA%\run-cppcheckon Windows. The log file may provide more information than the editor plugin if analysis fails. - enable_logging: Default is
true. - extra_args: Extra arguments to pass to cppcheck. Example:
["--enable=style"].
NOTE: Some plugins use the --version flag to determine the version of cppcheck. For these plugin, you need
to place a run-cppcheck-config.json in the directory where the plugin runs the command, providing the cppcheck field.
If this configuration is not found, run-cppcheck tries to find cppcheck in PATH.