Skip to content

Commit

Permalink
Fix version number reasoning
Browse files Browse the repository at this point in the history
  • Loading branch information
johnbowen42 committed Nov 14, 2024
1 parent 958405c commit 9a33df6
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 8 deletions.
15 changes: 10 additions & 5 deletions scripts/githooks/pre-commit
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
#!/bin/bash

# Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and
# other Axom Project Developers. See the top-level LICENSE file for details.
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# Copyright (c) 2016-24, Lawrence Livermore National Security, LLC
# and RAJA project contributors. See the RAJA/LICENSE file for details.
#
# SPDX-License-Identifier: (BSD-3-Clause)
# SPDX-License-Identifier: (BSD-3-Clause)
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

# List of file extensions to format
file_extensions=("cpp" "h" "c" "hpp")
Expand All @@ -19,12 +21,15 @@ else
exit 0
fi

# Check if clang-format exists
# Check the major version of the provided clang-format
VERSION_STRING=$($__clang_format_executable --version)
MAJOR_VERSION=$(echo "$VERSION_STRING" | grep -oP '\d+' | head -1)

if [ "$VERSION_STRING" != "clang-format version 14.0.6" ]; then
if [ "$MAJOR_VERSION" != "14" ]; then
echo "Warning: RAJA_CLANG_FORMAT not set to a valid version number."
exit 0
else
echo "Using clang-format at $RAJA_CLANG_FORMAT"
fi

# Convert file extensions array to regex pattern
Expand Down
8 changes: 5 additions & 3 deletions scripts/setup-hooks.sh
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
#!/usr/bin/env bash

# Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and
# other Axom Project Developers. See the top-level LICENSE file for details.
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# Copyright (c) 2016-24, Lawrence Livermore National Security, LLC
# and RAJA project contributors. See the RAJA/LICENSE file for details.
#
# SPDX-License-Identifier: (BSD-3-Clause)
# SPDX-License-Identifier: (BSD-3-Clause)
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

#------------------------------------------------------------------------------
# This script installs client-side hooks
Expand Down

0 comments on commit 9a33df6

Please sign in to comment.