Refactored tools structure & conventions for reuse (#685)

1.  All common tools are hosted and managed in
    the tools directory (used for both local development
    and continuous integration)
2.  Each tool comprises a directory, akin to a bundle,
    that encapsulates declarative command-line options,
    configuration files and a run script
3.  A single bootstrap script configures a
    development environment
4.  A lightweight runtime provides a common set of
    convenience functions and variables to all scripts

References #672
This commit is contained in:
Bruce Lacey
2016-12-11 09:40:32 +01:00
committed by Olivier
parent 37881d56ba
commit 28e0086291
14 changed files with 526 additions and 79 deletions
+33
View File
@@ -0,0 +1,33 @@
#!/bin/bash
# instantiate mysensors tool runtime shim
. "$(git mystoolspath).bundle_runtime.sh"
###
# astyle
#
errorsDetected=0
for file in $(stagedSourceFiles); do
git astyle $file >/dev/null
if ! git diff-files --quiet $file >&2; then
warn "$file has been updated to match the MySensors core coding style."
errorsDetected=1
fi
done
[ $errorsDetected == 1 ] && err "Styling updates applied. Review the changes and use 'git add' to update your staged files."
###
# cppcheck
#
errorsDetected=0
for file in $(stagedSourceFiles); do
if ! git cppcheck $file >/dev/null; then
warn "$file failed static analysis."
errorsDetected=1
fi
done
[ $errorsDetected == 1 ] && err "Correct the errors until cppcheck passees using 'git cppcheck --cached'."
exit 0