diff --git a/.github/workflows/housekeeping.yml b/.github/workflows/housekeeping.yml index c5ade3c6dd..e0a27d75fc 100644 --- a/.github/workflows/housekeeping.yml +++ b/.github/workflows/housekeeping.yml @@ -1,4 +1,4 @@ -name: Housekeeping checks +name: Housekeeping Checks on: # allows us to run workflows manually @@ -6,23 +6,27 @@ on: pull_request: branches: - develop + paths: + - 'src/**' + - '.github/workflows/housekeeping.yml' jobs: - Housekeeping: + main: runs-on: ubuntu-latest - container: - image: ghcr.io/svalinn/dagmc-ci-ubuntu-18.04-housekeeping:stable - steps: - - name: Checkout repository - uses: actions/checkout@v3 + steps: - name: Setup environment run: | echo "REPO_SLUG=${GITHUB_REPOSITORY}" >> $GITHUB_ENV echo "PULL_REQUEST=$(echo $GITHUB_REF | cut -d"/" -f3)" >> $GITHUB_ENV - mkdir /root/build_dir - ln -s $GITHUB_WORKSPACE /root/build_dir/DAGMC - + + - name: Setup dependencies + run: | + sudo apt-get install -y clang-format + + - name: Checkout repository + uses: actions/checkout@v3 + - name: Housekeeping run: | cd $GITHUB_WORKSPACE @@ -32,10 +36,24 @@ jobs: -exec clang-format -style=file -i {} \; clang_diffs=`git status --porcelain` if [ -z "${clang_diffs}" ]; then - echo "Style guide checker passed!" + echo -e "\033[32mStyle guide checker passed!\033[0m" else - echo "ERROR: Style guide checker failed. Please run clang-format." - echo "clang_diffs: ${clang_diffs}" + echo -e "\033[1;31mERROR: Style guide checker failed. Please run clang-format.\033[0m" + echo + echo -e "\033[33mClang diffs:\033[0m" + echo "${clang_diffs}" + echo + echo -e "\033[33mGit diff:\033[0m" git diff + echo + echo -e "\033[1;31mPlease fix the style guide and commit the result.\033[0m" + echo + echo "You can use the following command to format all files at once." + echo + echo "find src/ \\( -name \"*.hpp\" -o -name \"*.cpp\" -o -name \"*.hh\" -o -name \"*.cc\" -o -name \"*.h\" \\) \\" + echo " \\( -not -path \"src/gtest*\" -not -path \"src/mcnp/mcnp?/Source/*\" -not -path \"src/pyne*\" \\) \\" + echo " -exec clang-format -style=file -i {} \\;" + echo + echo "This command will automatically format your code according to the project's style guide." exit 1 fi diff --git a/.github/workflows/windows_build_test.yml b/.github/workflows/windows_build_test.yml index 004664742d..a2a9ba273a 100644 --- a/.github/workflows/windows_build_test.yml +++ b/.github/workflows/windows_build_test.yml @@ -76,6 +76,7 @@ jobs: -DBUILD_SHARED_LIBS=ON \ -G"Visual Studio 16 2019" \ -DCMAKE_INSTALL_PREFIX=../install_dir/ \ + -DEIGEN3_DIR="${CONDA_LOC}/include/eigen3" \ -DHDF5_ROOT="${CONDA_LOC}" \ -DHDF5_hdf5_LIBRARY_RELEASE="${CONDA_LOC}/lib/libhdf5_hl.lib;${CONDA_LOC}/lib/libhdf5.lib;${CONDA_LOC}/lib/zlib.lib;${CONDA_LOC}/lib/libhdf5_cpp.lib" \ -DCMAKE_EXE_LINKER_FLAGS="/std:c++latest -DH5_BUILT_AS_DYNAMIC_LIB" \ diff --git a/CI/Dockerfile_1_housekeeping b/CI/Dockerfile_1_housekeeping deleted file mode 100644 index 43065975c4..0000000000 --- a/CI/Dockerfile_1_housekeeping +++ /dev/null @@ -1,7 +0,0 @@ -ARG UBUNTU_VERSION=18.04 -ARG OWNER=svalinn -ARG TAG=latest -FROM ghcr.io/${OWNER}/dagmc-ci-ubuntu-${UBUNTU_VERSION}:$TAG - -RUN pip install sphinx; \ - apt-get -y install clang-format diff --git a/doc/CHANGELOG.rst b/doc/CHANGELOG.rst index f0ed5d9a71..d821a52096 100644 --- a/doc/CHANGELOG.rst +++ b/doc/CHANGELOG.rst @@ -13,7 +13,7 @@ Next version * Ensure implicit complement handle is placed at the back of DAGMC volume indices (#935) * Update MOAB to 5.5.1 from 5.3.0 (#939 #940) * Update README regarding OpenMC (#938) - + * Simplify Housekeeping Process for DAGMC (#943) v3.2.3 ==================== diff --git a/src/dagmc/DagMC.hpp b/src/dagmc/DagMC.hpp index 47c10842a4..45744bc286 100644 --- a/src/dagmc/DagMC.hpp +++ b/src/dagmc/DagMC.hpp @@ -78,12 +78,10 @@ class DagMC { double overlap_tolerance = 0., double numerical_precision = .001, int verbosity = 1); // Deprecated Constructor - [ - [deprecated("Replaced by DagMC(std::shared_ptr mb_impl, ... " - ")")]] DagMC(Interface* mb_impl, - double overlap_tolerance = 0., - double numerical_precision = .001, - int verbosity = 1); + [[deprecated( + "Replaced by DagMC(std::shared_ptr mb_impl, ... " + ")")]] DagMC(Interface* mb_impl, double overlap_tolerance = 0., + double numerical_precision = .001, int verbosity = 1); // Destructor ~DagMC(); diff --git a/src/dagmc/tools/ray_fire_test.cpp b/src/dagmc/tools/ray_fire_test.cpp index ee4b5f25eb..13e9f45dca 100644 --- a/src/dagmc/tools/ray_fire_test.cpp +++ b/src/dagmc/tools/ray_fire_test.cpp @@ -31,7 +31,7 @@ extern "C" int getrusage(int, struct rusage*); using namespace moab; // define following macro for verbose debugging of random ray generation -//#define DEBUG +// #define DEBUG #if !defined(_MSC_VER) && !defined(__MINGW32__) void get_time_mem(double& tot_time, double& user_time, double& sys_time, double& tot_mem); diff --git a/src/geant4/DagSolid.cc b/src/geant4/DagSolid.cc index 0e15537160..05b8d4c97a 100644 --- a/src/geant4/DagSolid.cc +++ b/src/geant4/DagSolid.cc @@ -69,7 +69,7 @@ using namespace moab; #define plot true -//#define G4SPECSDEBUG 1 +// #define G4SPECSDEBUG 1 /////////////////////////////////////////////////////////////////////////////// // // Standard contructor has blank name and defines no facets. diff --git a/src/geant4/app/include/ExN01UserScoreWriter.hh b/src/geant4/app/include/ExN01UserScoreWriter.hh index 35b2a11ec1..17dd1b1c9c 100644 --- a/src/geant4/app/include/ExN01UserScoreWriter.hh +++ b/src/geant4/app/include/ExN01UserScoreWriter.hh @@ -1,7 +1,6 @@ #ifndef ExN01UserScoreWriter_h #define ExN01UserScoreWriter_h 1 -//#include "MBCore.hpp" #include #include "G4VScoreWriter.hh" diff --git a/src/tally/CellTally.cpp b/src/tally/CellTally.cpp index f89c98ce51..53f52b4b0e 100644 --- a/src/tally/CellTally.cpp +++ b/src/tally/CellTally.cpp @@ -52,9 +52,9 @@ void CellTally::write_data(double num_histories) { std::cout << "cell id = " << cell_id << std::endl; std::cout << "type = " - << (expected_type == TallyEvent::COLLISION - ? "collision " - : expected_type == TallyEvent::TRACK ? "track " : "none"); + << (expected_type == TallyEvent::COLLISION ? "collision " + : expected_type == TallyEvent::TRACK ? "track " + : "none"); std::cout << std::endl; std::cout << "volume = " << cell_volume << std::endl << std::endl;