diff --git a/tools/.tidy-check-license-headers b/tools/.tidy-check-license-headers new file mode 100644 index 0000000..3c5d9a0 --- /dev/null +++ b/tools/.tidy-check-license-headers @@ -0,0 +1 @@ +git ls-files '*.sh' # TODO: check more files diff --git a/tools/publish.sh b/tools/publish.sh index df6eaae..9ba2029 100755 --- a/tools/publish.sh +++ b/tools/publish.sh @@ -1,10 +1,11 @@ #!/usr/bin/env bash +# SPDX-License-Identifier: Apache-2.0 OR MIT set -euo pipefail IFS=$'\n\t' cd "$(dirname "$0")"/.. # shellcheck disable=SC2154 -trap 's=$?; echo >&2 "$0: Error on line "${LINENO}": ${BASH_COMMAND}"; exit ${s}' ERR +trap 's=$?; echo >&2 "$0: error on line "${LINENO}": ${BASH_COMMAND}"; exit ${s}' ERR # Publish a new release. # diff --git a/tools/tidy.sh b/tools/tidy.sh index 10f2a4c..d48866c 100755 --- a/tools/tidy.sh +++ b/tools/tidy.sh @@ -6,7 +6,7 @@ IFS=$'\n\t' cd "$(dirname "$0")"/.. # shellcheck disable=SC2154 -trap 's=$?; echo >&2 "$0: Error on line "${LINENO}": ${BASH_COMMAND}"; exit ${s}' ERR +trap 's=$?; echo >&2 "$0: error on line "${LINENO}": ${BASH_COMMAND}"; exit ${s}' ERR # USAGE: # ./tools/tidy.sh @@ -201,6 +201,44 @@ else warn "'shellcheck' is not installed" fi +# License check +# TODO: This check is still experimental and does not track all files that should be tracked. +if [[ -f tools/.tidy-check-license-headers ]]; then + info "checking license headers (experimental)" + failed_files='' + for p in $(eval $(