1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35
|
#!/bin/bash
###############################################################################
# Copyright (C) Intel Corporation
#
# SPDX-License-Identifier: MIT
###############################################################################
# Check code for issues.
if [ -z "$BASH_VERSION" ]
then
echo "This script must be run under bash"
exit 1
fi
if [ "$0" = "$BASH_SOURCE" ]
then
set -o errexit
else
echo "Warning: This script should not be sourced. Skipping exit on error."
fi
# Set script folder
SCRIPT_DIR="$( cd "$(dirname "${BASH_SOURCE[0]:-$0}")" >/dev/null 2>&1 ; pwd -P )"
# Set root folder
PROJ_DIR="$( dirname "${SCRIPT_DIR}" )"
pushd "${PROJ_DIR}"
echo "Check commit-msg"
gitlint
echo "Check commit"
pre-commit run --all-files
popd
|