From cdf7254acc5aef043cccd3cdadc701e7785e47c6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Xose=20P=C3=A9rez?= Date: Mon, 26 Feb 2018 13:00:54 +0100 Subject: [PATCH] Add cppcheck preaction to extra_scripts.py (disabled atm) --- code/extra_scripts.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/code/extra_scripts.py b/code/extra_scripts.py index 77123648..fb9faa34 100644 --- a/code/extra_scripts.py +++ b/code/extra_scripts.py @@ -1,5 +1,8 @@ #!/usr/bin/env python +from subprocess import call +import os import time + Import("env") # ------------------------------------------------------------------------------ @@ -31,6 +34,11 @@ def clr(color, text): # Callbacks # ------------------------------------------------------------------------------ +def cpp_check(source, target, env): + print("Started cppcheck...\n") + call(["cppcheck", os.getcwd()+"/espurna", "--force", "--enable=all"]) + print("Finished cppcheck...\n") + def check_size(source, target, env): time.sleep(2) size = target[0].get_size() @@ -55,5 +63,6 @@ def add_build_flags(source, target, env): # Hooks # ------------------------------------------------------------------------------ +#env.AddPreAction("buildprog", cpp_check) env.AddPreAction("$BUILD_DIR/src/espurna.ino.o", add_build_flags) env.AddPostAction("$BUILD_DIR/${PROGNAME}.bin", check_size)