mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2025-12-06 15:59:52 +03:00
version 1.3.0
This commit is contained in:
28
checkcode.py
Normal file
28
checkcode.py
Normal file
@@ -0,0 +1,28 @@
|
||||
#!/usr/bin/env python
|
||||
from subprocess import call
|
||||
import os
|
||||
Import("env")
|
||||
|
||||
|
||||
def code_check(source, target, env):
|
||||
print("\n** Starting cppcheck...")
|
||||
call(["cppcheck", os.getcwd()+"/.", "--force", "--enable=all"])
|
||||
print("\n** Finished cppcheck...\n")
|
||||
print("\n** Starting cpplint...")
|
||||
call(["cpplint", "--extensions=ino,cpp,h", "--filter=-legal/copyright,-build/include,-whitespace",
|
||||
"--linelength=120", "--recursive", "src"])
|
||||
print("\n** Finished cpplint...")
|
||||
|
||||
#my_flags = env.ParseFlags(env['BUILD_FLAGS'])
|
||||
#defines = {k: v for (k, v) in my_flags.get("CPPDEFINES")}
|
||||
# print defines
|
||||
# print env.Dump()
|
||||
|
||||
|
||||
# built in targets: (buildprog, size, upload, program, buildfs, uploadfs, uploadfsota)
|
||||
env.AddPreAction("buildprog", code_check)
|
||||
# env.AddPostAction(.....)
|
||||
|
||||
# see http://docs.platformio.org/en/latest/projectconf/advanced_scripting.html#before-pre-and-after-post-actions
|
||||
# env.Replace(PROGNAME="firmware_%s" % defines.get("VERSION"))
|
||||
env.Replace(PROGNAME="firmware_%s" % env['BOARD'])
|
||||
Reference in New Issue
Block a user