From 79e977972dd08fcc5afe720ee2e75d1687b87f55 Mon Sep 17 00:00:00 2001 From: Graham Harper Date: Fri, 3 Nov 2023 10:32:20 -0600 Subject: [PATCH] MueLu: Apply clang-format 14.0.6 and see if it's compatible with the workflow --- packages/muelu/.clang-format | 2 +- .../Misc/MueLu_AggregateQualityEstimateFactory_def.hpp | 2 +- packages/muelu/src/Misc/MueLu_DemoFactory_def.hpp | 4 ++-- .../Transfers/Classical/MueLu_ClassicalPFactory_def.hpp | 4 ++-- packages/muelu/test/unit_tests/Hierarchy.cpp | 8 ++++---- packages/muelu/utils/run_clang_format.sh | 4 ++-- 6 files changed, 12 insertions(+), 12 deletions(-) diff --git a/packages/muelu/.clang-format b/packages/muelu/.clang-format index 137569c6fc4c..d5e27b43ad2f 100644 --- a/packages/muelu/.clang-format +++ b/packages/muelu/.clang-format @@ -1,4 +1,4 @@ -#Official Tool: clang-format version 14.0.0 +#Official Tool: clang-format version 14.0.0, 14.0.6 #Kokkos options BasedOnStyle: google SortIncludes: false diff --git a/packages/muelu/src/Misc/MueLu_AggregateQualityEstimateFactory_def.hpp b/packages/muelu/src/Misc/MueLu_AggregateQualityEstimateFactory_def.hpp index 7ceeb514a3cd..e1117f1b6033 100644 --- a/packages/muelu/src/Misc/MueLu_AggregateQualityEstimateFactory_def.hpp +++ b/packages/muelu/src/Misc/MueLu_AggregateQualityEstimateFactory_def.hpp @@ -325,7 +325,7 @@ void AggregateQualityEstimateFactory: DenseVector workArray(14 * (aggSize + 1), false); - LO (*ptr2func) + LO(*ptr2func) (MT*, MT*, MT*); ptr2func = NULL; LO* bwork = NULL; diff --git a/packages/muelu/src/Misc/MueLu_DemoFactory_def.hpp b/packages/muelu/src/Misc/MueLu_DemoFactory_def.hpp index 5b524604aac4..cc7a327b79f9 100644 --- a/packages/muelu/src/Misc/MueLu_DemoFactory_def.hpp +++ b/packages/muelu/src/Misc/MueLu_DemoFactory_def.hpp @@ -62,13 +62,13 @@ template DemoFactory::~DemoFactory() {} template -void DemoFactory::DeclareInput(Level & /* currentLevel */) const { +void DemoFactory::DeclareInput(Level& /* currentLevel */) const { // TODO: declare input for factory // Input(currentLevel, varName_); } template -void DemoFactory::Build(Level & /* currentLevel */) const { +void DemoFactory::Build(Level& /* currentLevel */) const { // TODO: implement factory } diff --git a/packages/muelu/src/Transfers/Classical/MueLu_ClassicalPFactory_def.hpp b/packages/muelu/src/Transfers/Classical/MueLu_ClassicalPFactory_def.hpp index 8654ba834f18..4af210f3352c 100644 --- a/packages/muelu/src/Transfers/Classical/MueLu_ClassicalPFactory_def.hpp +++ b/packages/muelu/src/Transfers/Classical/MueLu_ClassicalPFactory_def.hpp @@ -607,8 +607,8 @@ void ClassicalPFactory:: } } else { // Case E - // Case E: Strong F-Point (adds to the first denominator if we don't share a - // a strong C-Point with i; adds to the second denominator otherwise) + // Case E: Strong F-Point (adds to the first denominator if we don't share a + // a strong C-Point with i; adds to the second denominator otherwise) #ifdef CMS_DEBUG printf("- A(%d,%d) is a strong F-Point\n", i, k); #endif diff --git a/packages/muelu/test/unit_tests/Hierarchy.cpp b/packages/muelu/test/unit_tests/Hierarchy.cpp index 3868ba754310..14cb183970c4 100644 --- a/packages/muelu/test/unit_tests/Hierarchy.cpp +++ b/packages/muelu/test/unit_tests/Hierarchy.cpp @@ -1569,10 +1569,10 @@ TEUCHOS_UNIT_TEST_TEMPLATE_4_DECL(Hierarchy, Write, Scalar, LocalOrdinal, Global char t[] = "XXXXXX"; int filedescriptor = 0; if (comm->getRank() == 0) - filedescriptor = mkstemp(t); // mkstemp() creates a temporary file. We use the name of that file as - // the suffix for the various data files produced by Hierarchy::Write(). - // A better solution would be to write to a file stream, but this would - // involve writing new interfaces to Epetra's file I/O capabilities. + filedescriptor = mkstemp(t); // mkstemp() creates a temporary file. We use the name of that file as + // the suffix for the various data files produced by Hierarchy::Write(). + // A better solution would be to write to a file stream, but this would + // involve writing new interfaces to Epetra's file I/O capabilities. TEST_INEQUALITY(filedescriptor, -1); // if the file descriptor is -1, it failed std::string tname(t); Teuchos::broadcast(*comm, 0, tname.size(), &tname[0]); diff --git a/packages/muelu/utils/run_clang_format.sh b/packages/muelu/utils/run_clang_format.sh index 86c871415da7..baeb18f2bf4c 100755 --- a/packages/muelu/utils/run_clang_format.sh +++ b/packages/muelu/utils/run_clang_format.sh @@ -21,8 +21,8 @@ else # get the clang-format version by running clang-format --version CLANGFORMAT_VERSION=$(clang-format --version) # check if clang-format result contains the string 14.0.0. if not, error out - if [[ ! "${CLANGFORMAT_VERSION}" =~ "14.0.0" ]] ; then - echo "Error! clang-format is not version 14.0.0, so it may have conflicts with the MueLu style!" + if [[ ! "${CLANGFORMAT_VERSION}" =~ "14.0.0" && ! "${CLANGFORMAT_VERSION}" =~ "14.0.6" ]] ; then + echo "Error! clang-format is not version 14.0.0 or 14.0.6, so it may have conflicts with the MueLu style!" echo "Detected clang-format version: ${CLANGFORMAT_VERSION}" echo "If you would like to run this anyway, you can force run this with" echo " ./utils/run_clang_format.sh -f"