2017-04-27 11:47:56 -07:00
|
|
|
#!/bin/bash -e
|
2018-10-07 13:52:23 -07:00
|
|
|
#
|
2022-01-12 11:21:41 -08:00
|
|
|
# Copyright 2013-2022 Lawrence Livermore National Security, LLC and other
|
2018-10-07 13:52:23 -07:00
|
|
|
# Spack Project Developers. See the top-level COPYRIGHT file for details.
|
|
|
|
#
|
|
|
|
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
|
|
|
|
2016-05-11 02:01:24 -07:00
|
|
|
#
|
2016-08-22 14:35:41 -05:00
|
|
|
# Description:
|
|
|
|
# Runs source code style checks on Spack.
|
|
|
|
# See $SPACK_ROOT/.flake8 for a list of
|
|
|
|
# approved exceptions.
|
2016-05-11 02:01:24 -07:00
|
|
|
#
|
2016-08-22 14:35:41 -05:00
|
|
|
# Usage:
|
|
|
|
# run-flake8-tests
|
|
|
|
#
|
2021-11-18 13:00:39 +01:00
|
|
|
. "$(dirname "$0")/setup.sh"
|
2016-05-11 02:01:24 -07:00
|
|
|
|
2021-11-18 13:00:39 +01:00
|
|
|
args=()
|
|
|
|
if [[ -n $GITHUB_BASE_REF ]]; then
|
|
|
|
args+=("--base" "${GITHUB_BASE_REF}")
|
2021-12-23 16:34:31 +01:00
|
|
|
else
|
|
|
|
args+=("--base" "${GITHUB_REF_NAME}")
|
2021-07-27 15:09:19 -07:00
|
|
|
fi
|
|
|
|
|
2018-10-07 21:59:04 -07:00
|
|
|
# verify that the code style is correct
|
2021-11-18 13:00:39 +01:00
|
|
|
spack style --root-relative "${args[@]}"
|
2018-10-07 21:59:04 -07:00
|
|
|
|
|
|
|
# verify that the license headers are present
|
|
|
|
spack license verify
|