mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2024-12-29 04:50:03 +01:00
60 lines
1.6 KiB
Bash
Executable File
60 lines
1.6 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
#
|
|
# Copyright (C) 2014 Martine Lenders <mlenders@inf.fu-berlin.de>
|
|
#
|
|
# This file is subject to the terms and conditions of the GNU Lesser
|
|
# General Public License v2.1. See the file LICENSE in the top level
|
|
# directory for more details.
|
|
#
|
|
|
|
: "${RIOTBASE:=$(cd $(dirname $0)/../../../; pwd)}"
|
|
cd $RIOTBASE
|
|
|
|
: "${RIOTTOOLS:=${RIOTBASE}/dist/tools}"
|
|
. "${RIOTTOOLS}"/pr_check/check_labels.sh
|
|
|
|
EXIT_CODE=0
|
|
|
|
if tput colors &> /dev/null && [ $(tput colors) -ge 8 ]; then
|
|
CERROR="\e[1;31m"
|
|
CRESET="\e[0m"
|
|
else
|
|
CERROR=
|
|
CRESET=
|
|
fi
|
|
|
|
if [[ ${#} -eq 1 ]]; then
|
|
RIOT_MASTER="${1}"
|
|
else
|
|
RIOT_MASTER="master"
|
|
fi
|
|
|
|
SQUASH_COMMITS="$(git log $(git merge-base HEAD "${RIOT_MASTER}")...HEAD --pretty=format:" %h %s" | \
|
|
grep -i -e "^ [0-9a-f]\+ .\{0,2\}SQUASH" -e "^ [0-9a-f]\+ .\{0,2\}FIX")"
|
|
|
|
if [ -n "${SQUASH_COMMITS}" ]; then
|
|
echo -e "${CERROR}Pull request needs squashing:${CRESET}" 1>&2
|
|
echo -e "${SQUASH_COMMITS}"
|
|
EXIT_CODE=1
|
|
fi
|
|
|
|
if [ -n "$TRAVIS_PULL_REQUEST" -o -n "$CI_PULL_NR" ]; then
|
|
if check_gh_label "CI: needs squashing"; then
|
|
echo -e "${CERROR}Pull request needs squashing according to its labels set on GitHub${CRESET}"
|
|
EXIT_CODE=1
|
|
fi
|
|
|
|
if check_gh_label "State: waiting for other PR"; then
|
|
echo -e "${CERROR}Pull request is waiting for another pull request according to its labels set on GitHub${CRESET}"
|
|
EXIT_CODE=1
|
|
fi
|
|
fi
|
|
|
|
if git grep -q PKG_SOURCE_LOCAL -- pkg/*/Makefile; then
|
|
echo -e "${CERROR}The following files contain a PKG_SOURCE_LOCAL definition:${CRESET}"
|
|
git grep -l PKG_SOURCE_LOCAL -- pkg/*/Makefile
|
|
EXIT_CODE=1
|
|
fi
|
|
|
|
exit ${EXIT_CODE}
|