[Bf-blender-cvs] [6e48a51af79] master: check_cppcheck: use quiet output

Campbell Barton noreply at git.blender.org
Mon Oct 4 04:19:38 CEST 2021


Commit: 6e48a51af7925e84988cb83f986a7d5d415a2ae2
Author: Campbell Barton
Date:   Mon Oct 4 13:12:37 2021 +1100
Branches: master
https://developer.blender.org/rB6e48a51af7925e84988cb83f986a7d5d415a2ae2

check_cppcheck: use quiet output

Without this, each cppcheck invocation included all defines/includes
flooding the console with unhelpful information.

Also remove nonexistent directory to exclude.

===================================================================

M	build_files/cmake/cmake_static_check_cppcheck.py

===================================================================

diff --git a/build_files/cmake/cmake_static_check_cppcheck.py b/build_files/cmake/cmake_static_check_cppcheck.py
index 79b0e236ce5..0e37b9ba468 100644
--- a/build_files/cmake/cmake_static_check_cppcheck.py
+++ b/build_files/cmake/cmake_static_check_cppcheck.py
@@ -36,7 +36,6 @@ USE_QUIET = (os.environ.get("QUIET", None) is not None)
 
 CHECKER_IGNORE_PREFIX = [
     "extern",
-    "intern/moto",
 ]
 
 CHECKER_BIN = "cppcheck"
@@ -49,6 +48,10 @@ CHECKER_ARGS = [
     #  "--check-config", # when includes are missing
     "--enable=all",  # if you want sixty hundred pedantic suggestions
 
+    # Quiet output, otherwise all defines/includes are printed (overly verbose).
+    # Only enable this for troubleshooting (if defines are not set as expected for example).
+    "--quiet",
+
     # NOTE: `--cppcheck-build-dir=<dir>` is added later as a temporary directory.
 ]
 
@@ -81,7 +84,10 @@ def cppcheck() -> None:
             percent_str = "[" + ("%.2f]" % percent).rjust(7) + " %:"
 
             sys.stdout.flush()
-            sys.stdout.write("%s " % percent_str)
+            sys.stdout.write("%s %s\n" % (
+                percent_str,
+                os.path.relpath(c, project_source_info.SOURCE_DIR)
+            ))
 
         return subprocess.Popen(cmd)



More information about the Bf-blender-cvs mailing list