From 014012a14c101bcce1de4646b77faadb7c432526 Mon Sep 17 00:00:00 2001 From: Kamil Dudka Date: Fri, 8 Nov 2024 09:28:56 +0100 Subject: [PATCH] cppcheck: improve documentation of --use-host-cppcheck ... to make it clear that the option requires statically linked cppcheck installed on the host. Resolves: https://github.com/csutils/csmock/issues/117 Closes: https://github.com/csutils/csmock/pull/194 --- py/plugins/cppcheck.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/py/plugins/cppcheck.py b/py/plugins/cppcheck.py index 1665d86..cae7e84 100644 --- a/py/plugins/cppcheck.py +++ b/py/plugins/cppcheck.py @@ -45,7 +45,7 @@ def enable(self): def init_parser(self, parser): parser.add_argument( "--use-host-cppcheck", action="store_true", - help="use host's Cppcheck instead of the one in chroot \ + help="use statically linked cppcheck installed on the host \ (automatically enables the Cppcheck plug-in)") parser.add_argument( @@ -103,6 +103,8 @@ def store_cppcheck_version_hook(results, mock): cmd = mock.get_mock_cmd(["--chroot", "cppcheck --version"]) (ec, verstr) = results.get_cmd_output(cmd, shell=False) if ec != 0: + if self.use_host_cppcheck: + results.error("--use-host-cppcheck expects statically linked cppcheck installed on the host", ec=0) results.error("failed to query cppcheck version", ec=ec) return ec