cppcheck: rewrite input file selection

Use git ls-files to build the initial file list so build artifacts don't
need to be manually specified like -src or -build.

Run the resulting list through a regex that filters out mako templates
and non c/c++ sources.  This removes the need to manually specify
scripts on the ignore list.

Run cppcheck on test code.  It should pass too.

Skip cppcheck when there aren't any files found since cppcheck will exit
with non-zero status and abort the overall CI run.

Pass the file list to cppcheck via stdin.  As a result, cppcheck needs
to be invoked with Popen rather than check_call so the file list can be
sent to cppcheck stdin.

Change-Id: I927b867b45a6c73cc64101af0588dc05a4da41ab
Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
1 file changed