From c4e76745858127df1e8243c5f7e631d1e1704d41 Mon Sep 17 00:00:00 2001 From: valeros Date: Wed, 30 Oct 2019 12:23:33 +0200 Subject: [PATCH] Don't pass header files to Cppcheck --- platformio/commands/check/tools/cppcheck.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/platformio/commands/check/tools/cppcheck.py b/platformio/commands/check/tools/cppcheck.py index f5a95ed5..20a28ec5 100644 --- a/platformio/commands/check/tools/cppcheck.py +++ b/platformio/commands/check/tools/cppcheck.py @@ -136,7 +136,10 @@ class CppcheckCheckTool(CheckToolBase): return fp.name def _generate_src_file(self): - return self._create_tmp_file("\n".join(self.get_project_src_files())) + src_files = [ + f for f in self.get_project_src_files() if not f.endswith((".h", ".hpp")) + ] + return self._create_tmp_file("\n".join(src_files)) def _generate_inc_file(self): return self._create_tmp_file("\n".join(self.cpp_includes))