tools/check: use RIOTTOOLS variable

Follow up to #9067 and part of #8821
This commit is contained in:
Gaëtan Harter 2018-03-22 17:21:09 +01:00
parent d6f9be77b5
commit ef13d91bed
No known key found for this signature in database
GPG Key ID: 76DF6BCF1B1F883B
7 changed files with 19 additions and 19 deletions

View File

@ -6,9 +6,8 @@
# General Public License v2.1. See the file LICENSE in the top level # General Public License v2.1. See the file LICENSE in the top level
# directory for more details. # directory for more details.
: ${RIOTBASE:=$(pwd)} : "${RIOTTOOLS:=${PWD}/dist/tools}"
. "${RIOTTOOLS}"/ci/changed_files.sh
. ${RIOTBASE}/dist/tools/ci/changed_files.sh
EXIT_CODE=0 EXIT_CODE=0
@ -26,7 +25,7 @@ indent() {
coccinelle_checkone() { coccinelle_checkone() {
OUT="$(spatch --very-quiet \ OUT="$(spatch --very-quiet \
--macro-file-builtins ${RIOTBASE}/dist/tools/coccinelle/include/riot-standard.h \ --macro-file-builtins ${RIOTTOOLS}/coccinelle/include/riot-standard.h \
--sp-file $patch ${FILES} | filter)" --sp-file $patch ${FILES} | filter)"
if [ -n "$OUT" ]; then if [ -n "$OUT" ]; then
@ -65,10 +64,9 @@ fi
: ${COCCINELLE_QUIET:=0} : ${COCCINELLE_QUIET:=0}
if [ -z "$*" ]; then if [ -z "$*" ]; then
coccinelle_checkall ${RIOTBASE}/dist/tools/coccinelle/force coccinelle_checkall "${RIOTTOOLS}"/coccinelle/force
COCCINELLE_WARNONLY=1 \ COCCINELLE_WARNONLY=1 coccinelle_checkall "${RIOTTOOLS}"/coccinelle/warn
coccinelle_checkall ${RIOTBASE}/dist/tools/coccinelle/warn
else else
for patch in "$@"; do for patch in "$@"; do
coccinelle_checkone "$patch" coccinelle_checkone "$patch"

View File

@ -8,7 +8,8 @@
# General Public License v2.1. See the file LICENSE in the top level # General Public License v2.1. See the file LICENSE in the top level
# directory for more details. # directory for more details.
. ${RIOTBASE:+${RIOTBASE}/}dist/tools/ci/changed_files.sh : "${RIOTTOOLS:=${PWD}/dist/tools}"
. "${RIOTTOOLS}"/ci/changed_files.sh
# Don't show warnings about unusedStructMembers by default # Don't show warnings about unusedStructMembers by default
DEFAULT_SUPPRESSIONS="${1}" DEFAULT_SUPPRESSIONS="${1}"

View File

@ -8,7 +8,8 @@
# General Public License v2.1. See the file LICENSE in the top level # General Public License v2.1. See the file LICENSE in the top level
# directory for more details. # directory for more details.
. ${RIOTBASE:+${RIOTBASE}/}dist/tools/ci/changed_files.sh : "${RIOTTOOLS:=${PWD}/dist/tools}"
. "${RIOTTOOLS}"/ci/changed_files.sh
# prepare # prepare
ROOT=$(git rev-parse --show-toplevel) ROOT=$(git rev-parse --show-toplevel)

View File

@ -17,9 +17,8 @@ else
CRESET= CRESET=
fi fi
DIST_TOOLS=${RIOTBASE:-.}/dist/tools : "${RIOTTOOLS:=${PWD}/dist/tools}"
. "${RIOTTOOLS}"/ci/changed_files.sh
. "${DIST_TOOLS}/ci/changed_files.sh"
FILES=$(FILEREGEX='(?=*.py$|pyterm$)' changed_files) FILES=$(FILEREGEX='(?=*.py$|pyterm$)' changed_files)
@ -33,7 +32,7 @@ ${FLAKE8_CMD} --version &> /dev/null || {
exit 1 exit 1
} }
ERRORS=$(${FLAKE8_CMD} --config="${DIST_TOOLS}/flake8/flake8.cfg" ${FILES}) ERRORS=$(${FLAKE8_CMD} --config="${RIOTTOOLS}"/flake8/flake8.cfg ${FILES})
if [ -n "${ERRORS}" ] if [ -n "${ERRORS}" ]
then then

View File

@ -6,9 +6,8 @@
# General Public License v2.1. See the file LICENSE in the top level # General Public License v2.1. See the file LICENSE in the top level
# directory for more details. # directory for more details.
: ${RIOTBASE:=$(pwd)} : "${RIOTTOOLS:=${PWD}/dist/tools}"
. "${RIOTTOOLS}"/ci/changed_files.sh
. ${RIOTBASE}/dist/tools/ci/changed_files.sh
EXIT_CODE=0 EXIT_CODE=0
@ -21,7 +20,7 @@ filter() {
} }
_headercheck() { _headercheck() {
OUT="$(${RIOTBASE}/dist/tools/headerguards/headerguards.py ${FILES} | filter)" OUT="$(${RIOTTOOLS}/headerguards/headerguards.py ${FILES} | filter)"
if [ -n "$OUT" ]; then if [ -n "$OUT" ]; then
EXIT_CODE=1 EXIT_CODE=1

View File

@ -7,7 +7,8 @@
# General Public License v2.1. See the file LICENSE in the top level # General Public License v2.1. See the file LICENSE in the top level
# directory for more details. # directory for more details.
. ${RIOTBASE:+${RIOTBASE}/}dist/tools/ci/changed_files.sh : "${RIOTTOOLS:=${PWD}/dist/tools}"
. "${RIOTTOOLS}"/ci/changed_files.sh
# customizable # customizable
CHECKROOT=$(dirname "${0}") CHECKROOT=$(dirname "${0}")

View File

@ -8,7 +8,8 @@
# #
EXIT_CODE=0 EXIT_CODE=0
source ./dist/tools/pr_check/check_labels.sh : "${RIOTTOOLS:=${PWD}/dist/tools}"
. "${RIOTTOOLS}"/pr_check/check_labels.sh
if tput colors &> /dev/null && [ $(tput colors) -ge 8 ]; then if tput colors &> /dev/null && [ $(tput colors) -ge 8 ]; then
CERROR="\e[1;31m" CERROR="\e[1;31m"