diff --git a/ci/publish.sh b/ci/publish.sh index 012676cb..6f784967 100755 --- a/ci/publish.sh +++ b/ci/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 # A list of paths to the crate to be published. # It will be published in the order listed. diff --git a/tools/.tidy-check-license-headers b/tools/.tidy-check-license-headers new file mode 100644 index 00000000..3c5d9a0c --- /dev/null +++ b/tools/.tidy-check-license-headers @@ -0,0 +1 @@ +git ls-files '*.sh' # TODO: check more files diff --git a/tools/ci.sh b/tools/ci.sh index 17b05ca0..6094a4a5 100755 --- a/tools/ci.sh +++ b/tools/ci.sh @@ -1,9 +1,10 @@ #!/usr/bin/env bash +# SPDX-License-Identifier: Apache-2.0 OR MIT set -euo pipefail IFS=$'\n\t' # 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 # Run a simplified version of the checks done by CI. # diff --git a/tools/publish.sh b/tools/publish.sh index df6eaae5..9ba2029d 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 10f2a4c9..d48866ca 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 $(