spack/share/spack/qa/run-style-tests
2025-01-02 15:40:28 +01:00

30 lines
622 B
Bash
Executable File

#!/bin/bash -e
#
# Copyright Spack Project Developers. See COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
#
# Description:
# Runs source code style checks on Spack.
# See $SPACK_ROOT/.flake8 for a list of
# approved exceptions.
#
# Usage:
# run-flake8-tests
#
. "$(dirname "$0")/setup.sh"
args=()
if [[ -n $GITHUB_BASE_REF ]]; then
args+=("--base" "${GITHUB_BASE_REF}")
else
args+=("--base" "${GITHUB_REF_NAME}")
fi
# verify that the code style is correct
spack style --root-relative "${args[@]}"
# verify that the license headers are present
spack license verify