From d9b8698cce79f33c9e680037d81eb289ea670f0d Mon Sep 17 00:00:00 2001 From: Adam Getchell Date: Mon, 23 Sep 2024 17:47:07 -0700 Subject: [PATCH 01/16] ci: Fix appveyor --- CMakeLists.txt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 6b06bf861..cacce0979 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -73,9 +73,13 @@ set(ENV{CGAL_DATA_DIR} CMAKE_BINARY_DIR/Data) # add_compile_options(/DNOMINMAX) #endif() +# Deal with /utf-8 flag on Windows if (MSVC) # Add /utf-8 flag for MSVC add_compile_options(/utf-8) +else() + # Add -finput-charset=UTF-8 for GCC and Clang + add_compile_options(-finput-charset=UTF-8) endif() # Project vcpkg dependencies From 404c2a8cec7d778ba974181e345a49ded1a913a4 Mon Sep 17 00:00:00 2001 From: Adam Getchell Date: Mon, 23 Sep 2024 18:07:04 -0700 Subject: [PATCH 02/16] ci: Fix pkgx windows error --- .github/workflows/windows-pkgx.yml | 4 ++++ cmake/StandardProjectSettings.cmake | 6 ------ 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/.github/workflows/windows-pkgx.yml b/.github/workflows/windows-pkgx.yml index 9d37437d8..1128fb5c1 100644 --- a/.github/workflows/windows-pkgx.yml +++ b/.github/workflows/windows-pkgx.yml @@ -25,6 +25,10 @@ jobs: with: +: clang@19 + - run: npm install + - run: clang --version + + - name: Restore artifacts, or setup vcpkg uses: lukka/run-vcpkg@v11 with: diff --git a/cmake/StandardProjectSettings.cmake b/cmake/StandardProjectSettings.cmake index bdd7314b1..8990f3300 100644 --- a/cmake/StandardProjectSettings.cmake +++ b/cmake/StandardProjectSettings.cmake @@ -54,9 +54,3 @@ add_definitions(-DCGAL_TRIANGULATION_NO_ASSERTIONS -DCGAL_TRIANGULATION_NO_POSTC # Easier navigation in an IDE when projects are organized in folders. set_property(GLOBAL PROPERTY USE_FOLDERS ON) - -# Check if the compiler is MSVC -if (MSVC) - # Add /utf-8 flag to MSVC - add_compile_options(/utf-8) -endif() From cb235de0d0bedc8f056a71b1755714be22abc399 Mon Sep 17 00:00:00 2001 From: Adam Getchell Date: Mon, 23 Sep 2024 18:10:17 -0700 Subject: [PATCH 03/16] ci: pkgx fixes [skip ci] --- .github/workflows/windows-pkgx.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/windows-pkgx.yml b/.github/workflows/windows-pkgx.yml index 1128fb5c1..6949a06cf 100644 --- a/.github/workflows/windows-pkgx.yml +++ b/.github/workflows/windows-pkgx.yml @@ -23,7 +23,7 @@ jobs: - name: Setup Clang uses: pkgxdev/setup@v2 with: - +: clang@19 + +: node@20, clang@19 - run: npm install - run: clang --version From 80aa298fc3b4272f9e54a5099cc19dbb24308764 Mon Sep 17 00:00:00 2001 From: Adam Getchell Date: Fri, 27 Sep 2024 04:47:38 -0700 Subject: [PATCH 04/16] ci: Updates [skip ci] --- .github/workflows/clang-format-check.yml | 2 +- .github/workflows/windows-pkgx.yml | 6 +----- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/.github/workflows/clang-format-check.yml b/.github/workflows/clang-format-check.yml index 9f6c23275..8d841a19e 100644 --- a/.github/workflows/clang-format-check.yml +++ b/.github/workflows/clang-format-check.yml @@ -22,6 +22,6 @@ jobs: - name: Run clang-format style check for C/C++/Protobuf programs. uses: jidicula/clang-format-action@v4.13.0 with: - clang-format-version: '18' + clang-format-version: '19' check-path: ${{ matrix.path }} fallback-style: 'Google' # optional \ No newline at end of file diff --git a/.github/workflows/windows-pkgx.yml b/.github/workflows/windows-pkgx.yml index 6949a06cf..9d37437d8 100644 --- a/.github/workflows/windows-pkgx.yml +++ b/.github/workflows/windows-pkgx.yml @@ -23,11 +23,7 @@ jobs: - name: Setup Clang uses: pkgxdev/setup@v2 with: - +: node@20, clang@19 - - - run: npm install - - run: clang --version - + +: clang@19 - name: Restore artifacts, or setup vcpkg uses: lukka/run-vcpkg@v11 From 221383bde62573170470638255898fbaf3dec6ae Mon Sep 17 00:00:00 2001 From: Adam Getchell Date: Fri, 27 Sep 2024 04:50:38 -0700 Subject: [PATCH 05/16] ci: Allow clang-format to run by request [skip ci] --- .github/workflows/clang-format-check.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/clang-format-check.yml b/.github/workflows/clang-format-check.yml index 8d841a19e..b1161fb09 100644 --- a/.github/workflows/clang-format-check.yml +++ b/.github/workflows/clang-format-check.yml @@ -7,6 +7,7 @@ on: pull_request: branches: - develop + workflow_dispatch: jobs: formatting-check: From f084b581790c1cbcbd0eab106a0d86befe7b0cc2 Mon Sep 17 00:00:00 2001 From: Adam Getchell Date: Fri, 1 Nov 2024 00:57:58 -0700 Subject: [PATCH 06/16] fix: strip out qt temporarily Until we can get it to compile again --- CMakeLists.txt | 5 +-- src/CMakeLists.txt | 72 +++++++++++++++++++++--------------------- src/bistellar-flip.cpp | 2 +- tests/CMakeLists.txt | 2 +- vcpkg.json | 10 +----- 5 files changed, 42 insertions(+), 49 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index cacce0979..42b479a28 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -30,7 +30,7 @@ include(cmake/PreventInSourceBuilds.cmake) # Link this 'library' to set the c++ standard / compile-time options requested add_library(project_options INTERFACE) -target_compile_features(project_options INTERFACE cxx_std_20) +target_compile_features(project_options INTERFACE cxx_std_23) if(CMAKE_CXX_COMPILER_ID MATCHES ".*Clang") option(ENABLE_BUILD_WITH_TIME_TRACE "Enable -ftime-trace to generate time tracing .json files on clang" OFF) @@ -85,7 +85,8 @@ endif() # Project vcpkg dependencies # https://github.com/CGAL/cgal -find_package(CGAL CONFIG REQUIRED OPTIONAL_COMPONENTS Qt5) +#find_package(CGAL CONFIG REQUIRED OPTIONAL_COMPONENTS Qt5) +find_package(CGAL CONFIG REQUIRED) # Don't let CGAL override flags set(CGAL_DONT_OVERRIDE_CMAKE_FLAGS TRUE diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 2566b8688..e7a6765bf 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -10,7 +10,7 @@ target_link_libraries( spdlog::spdlog_header_only TBB::tbb CGAL::CGAL) -target_compile_features(initialize PRIVATE cxx_std_20) +target_compile_features(initialize PRIVATE cxx_std_23) add_executable(cdt-opt ${PROJECT_SOURCE_DIR}/src/cdt-opt.cpp) target_link_libraries( @@ -23,7 +23,7 @@ target_link_libraries( spdlog::spdlog_header_only TBB::tbb CGAL::CGAL) -target_compile_features(cdt-opt PRIVATE cxx_std_20) +target_compile_features(cdt-opt PRIVATE cxx_std_23) add_executable(cdt ${PROJECT_SOURCE_DIR}/src/cdt.cpp) target_link_libraries( @@ -37,40 +37,40 @@ target_link_libraries( spdlog::spdlog_header_only TBB::tbb CGAL::CGAL) -target_compile_features(cdt PRIVATE cxx_std_20) +target_compile_features(cdt PRIVATE cxx_std_23) # Build cdt-viewer locally, but not in CI since QT takes more than an hour to build there -if(APPLE AND NOT ($ENV{CI})) - add_executable(cdt-viewer ${PROJECT_SOURCE_DIR}/src/cdt-viewer.cpp) - target_link_libraries( - cdt-viewer - PRIVATE project_options - project_warnings - date::date-tz - Boost::program_options - fmt::fmt-header-only - Eigen3::Eigen - spdlog::spdlog_header_only - TBB::tbb - CGAL::CGAL_Basic_viewer) - target_compile_features(cdt-viewer PRIVATE cxx_std_20) -endif() +#if(APPLE AND NOT ($ENV{CI})) +# add_executable(cdt-viewer ${PROJECT_SOURCE_DIR}/src/cdt-viewer.cpp) +# target_link_libraries( +# cdt-viewer +# PRIVATE project_options +# project_warnings +# date::date-tz +# Boost::program_options +# fmt::fmt-header-only +# Eigen3::Eigen +# spdlog::spdlog_header_only +# TBB::tbb +# CGAL::CGAL_Basic_viewer) +# target_compile_features(cdt-viewer PRIVATE cxx_std_20) +#endif() # Build bistellar-flip locally, but not in CI since QT takes more than an hour to build there -if(APPLE AND NOT ($ENV{CI})) - add_executable(bistellar-flip ${PROJECT_SOURCE_DIR}/src/bistellar-flip.cpp) - target_link_libraries( - bistellar-flip - PRIVATE project_options - project_warnings - date::date-tz - fmt::fmt-header-only - Eigen3::Eigen - spdlog::spdlog_header_only - TBB::tbb - CGAL::CGAL_Basic_viewer) - target_compile_features(bistellar-flip PRIVATE cxx_std_20) -endif() +#if(APPLE AND NOT ($ENV{CI})) +# add_executable(bistellar-flip ${PROJECT_SOURCE_DIR}/src/bistellar-flip.cpp) +# target_link_libraries( +# bistellar-flip +# PRIVATE project_options +# project_warnings +# date::date-tz +# fmt::fmt-header-only +# Eigen3::Eigen +# spdlog::spdlog_header_only +# TBB::tbb) +# CGAL::CGAL_Basic_viewer) +# target_compile_features(bistellar-flip PRIVATE cxx_std_20) +#endif() # # Tests ## @@ -105,7 +105,7 @@ set_tests_properties(initialize-toroidal PROPERTIES PASS_REGULAR_EXPRESSION add_test(NAME cdt-opt COMMAND $) set_tests_properties(cdt-opt PROPERTIES PASS_REGULAR_EXPRESSION "cdt-opt started at") -if(APPLE AND NOT ($ENV{CI})) - add_test(NAME cdt-viewer COMMAND $ --dry-run test.off) - set_tests_properties(cdt-viewer PROPERTIES PASS_REGULAR_EXPRESSION "Dry run. Exiting.") -endif() +#if(APPLE AND NOT ($ENV{CI})) +# add_test(NAME cdt-viewer COMMAND $ --dry-run test.off) +# set_tests_properties(cdt-viewer PROPERTIES PASS_REGULAR_EXPRESSION "Dry run. Exiting.") +#endif() diff --git a/src/bistellar-flip.cpp b/src/bistellar-flip.cpp index b2fc4721c..2e7276f63 100644 --- a/src/bistellar-flip.cpp +++ b/src/bistellar-flip.cpp @@ -69,7 +69,7 @@ try manifolds::Manifold_3 const manifold{ foliated_triangulations::FoliatedTriangulation_3{dt, 0, 1} }; - CGAL::draw(manifold.get_delaunay()); +// CGAL::draw(manifold.get_delaunay()); fmt::print("After bistellar flip.\n"); manifold.print_cells(); utilities::print_delaunay(dt); diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 67590809d..750e30a82 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -18,7 +18,7 @@ add_executable( Utilities_test.cpp Vertex_test.cpp) # Activate C++20 features -target_compile_features(CDT_unit_tests PRIVATE cxx_std_20) +target_compile_features(CDT_unit_tests PRIVATE cxx_std_23) target_link_libraries( CDT_unit_tests PRIVATE project_options diff --git a/vcpkg.json b/vcpkg.json index 215b18ed7..90b087939 100644 --- a/vcpkg.json +++ b/vcpkg.json @@ -16,14 +16,6 @@ "name": "yasm-tool", "platform": "windows" }, - { - "name": "cgal", - "features": ["qt"], - "platform": "osx" - }, - { - "name": "cgal", - "platform": "!osx" - } + "cgal" ] } \ No newline at end of file From 26a60588862db6c3d3df8e98ce95e54e97e1302a Mon Sep 17 00:00:00 2001 From: Adam Getchell Date: Fri, 1 Nov 2024 15:15:39 -0700 Subject: [PATCH 07/16] fix: CoderabbitAI suggestions --- .coderabbit.yaml | 92 ++++++++++++++++++++++++ .github/workflows/clang-format-check.yml | 2 +- CMakeLists.txt | 9 --- cmake/StandardProjectSettings.cmake | 10 ++- tests/CMakeLists.txt | 2 +- 5 files changed, 103 insertions(+), 12 deletions(-) create mode 100644 .coderabbit.yaml diff --git a/.coderabbit.yaml b/.coderabbit.yaml new file mode 100644 index 000000000..af1abac06 --- /dev/null +++ b/.coderabbit.yaml @@ -0,0 +1,92 @@ +language: en-US +tone_instructions: '' +early_access: true +enable_free_tier: true +reviews: + profile: assertive + request_changes_workflow: false + high_level_summary: true + high_level_summary_placeholder: '@coderabbitai summary' + auto_title_placeholder: '@coderabbitai' + review_status: true + commit_status: true + poem: true + collapse_walkthrough: false + sequence_diagrams: true + changed_files_summary: true + labeling_instructions: [] + path_filters: [] + path_instructions: [] + abort_on_close: true + auto_review: + enabled: true + auto_incremental_review: true + ignore_title_keywords: [] + labels: [] + drafts: true + base_branches: [] + tools: + shellcheck: + enabled: true + ruff: + enabled: true + markdownlint: + enabled: true + github-checks: + enabled: true + timeout_ms: 90000 + languagetool: + enabled: true + enabled_only: false + level: default + biome: + enabled: true + hadolint: + enabled: true + swiftlint: + enabled: true + phpstan: + enabled: true + level: default + golangci-lint: + enabled: true + yamllint: + enabled: true + gitleaks: + enabled: true + checkov: + enabled: true + detekt: + enabled: true + eslint: + enabled: true + rubocop: + enabled: true + buf: + enabled: true + regal: + enabled: true + actionlint: + enabled: true + pmd: + enabled: true + cppcheck: + enabled: true + semgrep: + enabled: true + circleci: + enabled: true +chat: + auto_reply: true +knowledge_base: + opt_out: false + learnings: + scope: auto + issues: + scope: auto + jira: + project_keys: [] + linear: + team_keys: [] + pull_requests: + scope: auto diff --git a/.github/workflows/clang-format-check.yml b/.github/workflows/clang-format-check.yml index b1161fb09..300122dbe 100644 --- a/.github/workflows/clang-format-check.yml +++ b/.github/workflows/clang-format-check.yml @@ -23,6 +23,6 @@ jobs: - name: Run clang-format style check for C/C++/Protobuf programs. uses: jidicula/clang-format-action@v4.13.0 with: - clang-format-version: '19' + clang-format-version: '18' check-path: ${{ matrix.path }} fallback-style: 'Google' # optional \ No newline at end of file diff --git a/CMakeLists.txt b/CMakeLists.txt index 42b479a28..646382afb 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -73,15 +73,6 @@ set(ENV{CGAL_DATA_DIR} CMAKE_BINARY_DIR/Data) # add_compile_options(/DNOMINMAX) #endif() -# Deal with /utf-8 flag on Windows -if (MSVC) - # Add /utf-8 flag for MSVC - add_compile_options(/utf-8) -else() - # Add -finput-charset=UTF-8 for GCC and Clang - add_compile_options(-finput-charset=UTF-8) -endif() - # Project vcpkg dependencies # https://github.com/CGAL/cgal diff --git a/cmake/StandardProjectSettings.cmake b/cmake/StandardProjectSettings.cmake index 8990f3300..d17caeba3 100644 --- a/cmake/StandardProjectSettings.cmake +++ b/cmake/StandardProjectSettings.cmake @@ -38,7 +38,7 @@ endif() # Set minimum Boost version set(BOOST_MIN_VERSION "1.75.0") -# Use C++20 +# Use C++23 set(CMAKE_CXX_STANDARD 23) set(CMAKE_CXX_STANDARD_REQUIRED ON) set(CMAKE_CXX_EXTENSIONS OFF) @@ -54,3 +54,11 @@ add_definitions(-DCGAL_TRIANGULATION_NO_ASSERTIONS -DCGAL_TRIANGULATION_NO_POSTC # Easier navigation in an IDE when projects are organized in folders. set_property(GLOBAL PROPERTY USE_FOLDERS ON) + +# Deal with UTF-8 encoding +if (MSVC) + add_compile_options(/utf-8) +else() + add_compile_options(-finput-charset=UTF-8) +endif() + diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 750e30a82..d5f9f79c5 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -17,7 +17,7 @@ add_executable( Torus_test.cpp Utilities_test.cpp Vertex_test.cpp) -# Activate C++20 features +# Activate C++23 features target_compile_features(CDT_unit_tests PRIVATE cxx_std_23) target_link_libraries( CDT_unit_tests From 8daf99c3a5a92cad6fa43c1c73cee6a839599593 Mon Sep 17 00:00:00 2001 From: Adam Getchell Date: Fri, 1 Nov 2024 15:47:11 -0700 Subject: [PATCH 08/16] fix: Coderabbit suggestions part 2 --- .coderabbit.yaml | 29 +++++++++++------------------ CMakeLists.txt | 8 ++++++++ cmake/StandardProjectSettings.cmake | 1 - src/CMakeLists.txt | 4 ++-- src/bistellar-flip.cpp | 2 +- 5 files changed, 22 insertions(+), 22 deletions(-) diff --git a/.coderabbit.yaml b/.coderabbit.yaml index af1abac06..fc524c4ad 100644 --- a/.coderabbit.yaml +++ b/.coderabbit.yaml @@ -1,5 +1,5 @@ language: en-US -tone_instructions: '' +tone_instructions: 'Be constructive and professional. Focus on technical accuracy while maintaining a friendly tone.' early_access: true enable_free_tier: true reviews: @@ -15,8 +15,16 @@ reviews: sequence_diagrams: true changed_files_summary: true labeling_instructions: [] - path_filters: [] - path_instructions: [] + path_filters: + - 'src/**/*.cpp' + - 'include/**/*.hpp' + path_instructions: + - path: 'src/**/*.cpp' + instructions: 'Focus on performance, memory management, and RAII principles' + - path: 'include/**/*.hpp' + instructions: 'Focus on design patterns, interfaces, and encapsulation' + - path: 'test/**/*.cpp' + instructions: 'Ensure comprehensive test coverage and proper test organization' abort_on_close: true auto_review: enabled: true @@ -28,8 +36,6 @@ reviews: tools: shellcheck: enabled: true - ruff: - enabled: true markdownlint: enabled: true github-checks: @@ -43,25 +49,12 @@ reviews: enabled: true hadolint: enabled: true - swiftlint: - enabled: true - phpstan: - enabled: true - level: default - golangci-lint: - enabled: true yamllint: enabled: true gitleaks: enabled: true checkov: enabled: true - detekt: - enabled: true - eslint: - enabled: true - rubocop: - enabled: true buf: enabled: true regal: diff --git a/CMakeLists.txt b/CMakeLists.txt index 646382afb..c9dae958d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -67,6 +67,14 @@ include(CMakeDependentOption) # Set CGAL_DATA_DIR to the location of the CGAL data files set(ENV{CGAL_DATA_DIR} CMAKE_BINARY_DIR/Data) +if(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC" AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS "19.34") + message(FATAL_ERROR "MSVC 19.34 or higher required for C++23 support") +elseif(CMAKE_CXX_COMPILER_ID STREQUAL "GNU" AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS "12.2") + message(FATAL_ERROR "GCC 12.2 or higher required for C++23 support") +elseif(CMAKE_CXX_COMPILER_ID MATCHES "Clang" AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS "16.0") + message(FATAL_ERROR "Clang 16.0 or higher required for C++23 support") +endif() + # Set NOMINMAX to avoid min/max macro errors on Windows in date.h #if(WIN32) # # Workaround for https://github.com/CGAL/cgal/issues/4665 and https://github.com/microsoft/vcpkg/issues/23572 diff --git a/cmake/StandardProjectSettings.cmake b/cmake/StandardProjectSettings.cmake index d17caeba3..83923a05e 100644 --- a/cmake/StandardProjectSettings.cmake +++ b/cmake/StandardProjectSettings.cmake @@ -61,4 +61,3 @@ if (MSVC) else() add_compile_options(-finput-charset=UTF-8) endif() - diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index e7a6765bf..22ef11b73 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -53,7 +53,7 @@ target_compile_features(cdt PRIVATE cxx_std_23) # spdlog::spdlog_header_only # TBB::tbb # CGAL::CGAL_Basic_viewer) -# target_compile_features(cdt-viewer PRIVATE cxx_std_20) +# target_compile_features(cdt-viewer PRIVATE cxx_std_23) #endif() # Build bistellar-flip locally, but not in CI since QT takes more than an hour to build there @@ -69,7 +69,7 @@ target_compile_features(cdt PRIVATE cxx_std_23) # spdlog::spdlog_header_only # TBB::tbb) # CGAL::CGAL_Basic_viewer) -# target_compile_features(bistellar-flip PRIVATE cxx_std_20) +# target_compile_features(bistellar-flip PRIVATE cxx_std_23) #endif() # diff --git a/src/bistellar-flip.cpp b/src/bistellar-flip.cpp index 2e7276f63..3a218f2d7 100644 --- a/src/bistellar-flip.cpp +++ b/src/bistellar-flip.cpp @@ -69,7 +69,7 @@ try manifolds::Manifold_3 const manifold{ foliated_triangulations::FoliatedTriangulation_3{dt, 0, 1} }; -// CGAL::draw(manifold.get_delaunay()); + // CGAL::draw(manifold.get_delaunay()); fmt::print("After bistellar flip.\n"); manifold.print_cells(); utilities::print_delaunay(dt); From 0add19b9ce815b10aaff11312b78abac7be8af8e Mon Sep 17 00:00:00 2001 From: Adam Getchell Date: Fri, 1 Nov 2024 16:03:34 -0700 Subject: [PATCH 09/16] fix: More Coderabbit tuning --- .coderabbit.yaml | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/.coderabbit.yaml b/.coderabbit.yaml index fc524c4ad..0d7e37af9 100644 --- a/.coderabbit.yaml +++ b/.coderabbit.yaml @@ -15,16 +15,18 @@ reviews: sequence_diagrams: true changed_files_summary: true labeling_instructions: [] - path_filters: - - 'src/**/*.cpp' - - 'include/**/*.hpp' + path_filters: [] path_instructions: - path: 'src/**/*.cpp' instructions: 'Focus on performance, memory management, and RAII principles' - path: 'include/**/*.hpp' instructions: 'Focus on design patterns, interfaces, and encapsulation' - path: 'test/**/*.cpp' - instructions: 'Ensure comprehensive test coverage and proper test organization' + instructions: | + Review the following unit test code written using doctest. Ensure the following: + - Comprehensive test coverage and proper test organization. + - The code adheres to best practices using doctest. + - Descriptive test names are used to clearly convey the intent of each test. abort_on_close: true auto_review: enabled: true From ccb47e75b40ea21e6bc6d06ec78f895c6cd5fcdb Mon Sep 17 00:00:00 2001 From: Adam Getchell Date: Fri, 1 Nov 2024 16:32:03 -0700 Subject: [PATCH 10/16] fix: AppleClang C++23 support check left out AppleClang --- .github/workflows/macos.yml | 10 +++++++++- CMakeLists.txt | 2 ++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index 8deafba94..afaf18501 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -1,6 +1,14 @@ name: macOS -on: [workflow_dispatch] +on: + push: + branches: + - main + - develop + pull_request: + branches: + - develop + workflow_dispatch: concurrency: group: ${{ github.workflow }}-${{ github.ref }} diff --git a/CMakeLists.txt b/CMakeLists.txt index c9dae958d..f76b2fb74 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -73,6 +73,8 @@ elseif(CMAKE_CXX_COMPILER_ID STREQUAL "GNU" AND CMAKE_CXX_COMPILER_VERSION VERSI message(FATAL_ERROR "GCC 12.2 or higher required for C++23 support") elseif(CMAKE_CXX_COMPILER_ID MATCHES "Clang" AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS "16.0") message(FATAL_ERROR "Clang 16.0 or higher required for C++23 support") +elseif(CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang" AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS "14.0") + message(FATAL_ERROR "AppleClang 14.0 or higher required for C++23 support") endif() # Set NOMINMAX to avoid min/max macro errors on Windows in date.h From 6be0d8a887dc8740b1fe3b188a24bda561bc62d2 Mon Sep 17 00:00:00 2001 From: Adam Getchell Date: Fri, 1 Nov 2024 20:53:33 -0700 Subject: [PATCH 11/16] Update src/bistellar-flip.cpp Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> --- src/bistellar-flip.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/bistellar-flip.cpp b/src/bistellar-flip.cpp index 3a218f2d7..4c2b79d42 100644 --- a/src/bistellar-flip.cpp +++ b/src/bistellar-flip.cpp @@ -69,7 +69,9 @@ try manifolds::Manifold_3 const manifold{ foliated_triangulations::FoliatedTriangulation_3{dt, 0, 1} }; - // CGAL::draw(manifold.get_delaunay()); + #ifdef ENABLE_VISUALIZATION + CGAL::draw(manifold.get_delaunay()); + #endif fmt::print("After bistellar flip.\n"); manifold.print_cells(); utilities::print_delaunay(dt); From d1c5ff92edefeb1d67a0cad1a82cbbe3e05ae6d7 Mon Sep 17 00:00:00 2001 From: Adam Getchell Date: Fri, 1 Nov 2024 20:56:06 -0700 Subject: [PATCH 12/16] ci: disable macos --- .github/workflows/macos.yml | 10 +--------- src/bistellar-flip.cpp | 6 +++--- 2 files changed, 4 insertions(+), 12 deletions(-) diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index afaf18501..8deafba94 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -1,14 +1,6 @@ name: macOS -on: - push: - branches: - - main - - develop - pull_request: - branches: - - develop - workflow_dispatch: +on: [workflow_dispatch] concurrency: group: ${{ github.workflow }}-${{ github.ref }} diff --git a/src/bistellar-flip.cpp b/src/bistellar-flip.cpp index 4c2b79d42..bb246094d 100644 --- a/src/bistellar-flip.cpp +++ b/src/bistellar-flip.cpp @@ -69,9 +69,9 @@ try manifolds::Manifold_3 const manifold{ foliated_triangulations::FoliatedTriangulation_3{dt, 0, 1} }; - #ifdef ENABLE_VISUALIZATION - CGAL::draw(manifold.get_delaunay()); - #endif +#ifdef ENABLE_VISUALIZATION + CGAL::draw(manifold.get_delaunay()); +#endif fmt::print("After bistellar flip.\n"); manifold.print_cells(); utilities::print_delaunay(dt); From 41fedd6e269981c599f40a3ecbdecbe217172e78 Mon Sep 17 00:00:00 2001 From: Adam Getchell Date: Fri, 1 Nov 2024 23:08:38 -0700 Subject: [PATCH 13/16] ci: Fix workflows mostly Note we also updated vcpkg --- .appveyor.yml | 3 ++- .coderabbit.yaml | 18 ++++-------------- .github/workflows/macos.yml | 20 +++++--------------- CMakeLists.txt | 8 ++++++-- 4 files changed, 17 insertions(+), 32 deletions(-) diff --git a/.appveyor.yml b/.appveyor.yml index 4915c710c..7e9aa6cd7 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -19,7 +19,8 @@ clone_script: && git submodule update --init --recursive environment: - APPVEYOR_SAVE_CACHE_ON_ERROR : true + APPVEYOR_SAVE_CACHE_ON_ERROR : false + APPVEYOR_CACHE_SKIP_RESTORE : true VCPKG_DEFAULT_TRIPLET: x64-windows VCPKG_ROOT: c:\tools\vcpkg diff --git a/.coderabbit.yaml b/.coderabbit.yaml index 0d7e37af9..61c75aefa 100644 --- a/.coderabbit.yaml +++ b/.coderabbit.yaml @@ -43,34 +43,24 @@ reviews: github-checks: enabled: true timeout_ms: 90000 + gitleaks: + enabled: true + cppcheck: + enabled: true languagetool: enabled: true enabled_only: false level: default - biome: - enabled: true hadolint: enabled: true yamllint: enabled: true - gitleaks: - enabled: true - checkov: - enabled: true - buf: - enabled: true - regal: - enabled: true actionlint: enabled: true pmd: enabled: true - cppcheck: - enabled: true semgrep: enabled: true - circleci: - enabled: true chat: auto_reply: true knowledge_base: diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index 8deafba94..140a60b11 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -18,21 +18,11 @@ jobs: - name: Setup run: | - rm /usr/local/bin/2to3 - rm /usr/local/bin/2to3-3.11 - rm /usr/local/bin/2to3-3.12 - rm /usr/local/bin/idle3 - rm /usr/local/bin/idle3.11 - rm /usr/local/bin/idle3.12 - rm /usr/local/bin/pydoc3 - rm /usr/local/bin/pydoc3.11 - rm /usr/local/bin/pydoc3.12 - rm /usr/local/bin/python3 - rm /usr/local/bin/python3.11 - rm /usr/local/bin/python3.12 - rm /usr/local/bin/python3-config - rm /usr/local/bin/python3.11-config - rm /usr/local/bin/python3.12-config + # Remove Python symlinks if they exist + for file in \ + /usr/local/bin/{2to3,idle3,pydoc3,python3,python3-config}{,-3.11,-3.12}; do + [ -L "$file" ] && sudo rm "$file" || true + done brew install automake autoconf autoconf-archive libtool texinfo yasm ninja python ccache pkg-config - name: Restore artifacts or setup vcpkg diff --git a/CMakeLists.txt b/CMakeLists.txt index f76b2fb74..42d290024 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.16...3.26) +cmake_minimum_required(VERSION 3.16) # vcpkg settings must be set before project() if(DEFINED ENV{VCPKG_ROOT} AND NOT DEFINED CMAKE_TOOLCHAIN_FILE) @@ -67,6 +67,11 @@ include(CMakeDependentOption) # Set CGAL_DATA_DIR to the location of the CGAL data files set(ENV{CGAL_DATA_DIR} CMAKE_BINARY_DIR/Data) +# Minimum compiler versions required for C++23 support: +# - MSVC 19.34 (Visual Studio 2022 version 17.4) +# - GCC 12.2 +# - AppleClang 14.0 +# - Clang 16.0 if(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC" AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS "19.34") message(FATAL_ERROR "MSVC 19.34 or higher required for C++23 support") elseif(CMAKE_CXX_COMPILER_ID STREQUAL "GNU" AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS "12.2") @@ -86,7 +91,6 @@ endif() # Project vcpkg dependencies # https://github.com/CGAL/cgal -#find_package(CGAL CONFIG REQUIRED OPTIONAL_COMPONENTS Qt5) find_package(CGAL CONFIG REQUIRED) # Don't let CGAL override flags set(CGAL_DONT_OVERRIDE_CMAKE_FLAGS From 23cfa34abc8664987d2ed44f4a788c836779bbac Mon Sep 17 00:00:00 2001 From: Adam Getchell Date: Tue, 5 Nov 2024 13:16:02 -0800 Subject: [PATCH 14/16] ci: CodeRabbit suggestions --- .appveyor.yml | 4 ++-- .github/workflows/macos.yml | 16 +++++++++++++--- 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/.appveyor.yml b/.appveyor.yml index 7e9aa6cd7..787b2512d 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -19,8 +19,8 @@ clone_script: && git submodule update --init --recursive environment: - APPVEYOR_SAVE_CACHE_ON_ERROR : false - APPVEYOR_CACHE_SKIP_RESTORE : true + APPVEYOR_SAVE_CACHE_ON_ERROR: false + APPVEYOR_CACHE_SKIP_RESTORE: true VCPKG_DEFAULT_TRIPLET: x64-windows VCPKG_ROOT: c:\tools\vcpkg diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index 140a60b11..9ef506ae1 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -19,10 +19,20 @@ jobs: - name: Setup run: | # Remove Python symlinks if they exist - for file in \ - /usr/local/bin/{2to3,idle3,pydoc3,python3,python3-config}{,-3.11,-3.12}; do - [ -L "$file" ] && sudo rm "$file" || true + declare -a python_files=("2to3" "idle3" "pydoc3" "python3" "python3-config") + declare -a python_versions=("3.11" "3.12") + echo "Checking and removing Python symlinks..." + for base in "${python_files[@]}"; do + for version in "${python_versions[@]}"; do + file="/usr/local/bin/${base}${version}" + [ -L "$file" ] && sudo rm "$file" || true + done done + echo "Python symlink cleanup completed." +# for file in \ +# /usr/local/bin/{2to3,idle3,pydoc3,python3,python3-config}{,-3.11,-3.12}; do +# [ -L "$file" ] && sudo rm "$file" || true +# done brew install automake autoconf autoconf-archive libtool texinfo yasm ninja python ccache pkg-config - name: Restore artifacts or setup vcpkg From f3a85646e78c82a897a5456025fb84434c266e53 Mon Sep 17 00:00:00 2001 From: Adam Getchell Date: Tue, 5 Nov 2024 13:19:50 -0800 Subject: [PATCH 15/16] ci: Fix comment [ci skip] --- .github/workflows/macos.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index 9ef506ae1..bc26cecea 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -18,7 +18,7 @@ jobs: - name: Setup run: | - # Remove Python symlinks if they exist + # Remove Python symlinks if they exist declare -a python_files=("2to3" "idle3" "pydoc3" "python3" "python3-config") declare -a python_versions=("3.11" "3.12") echo "Checking and removing Python symlinks..." From 98d26d511059df7d8f6f0bdb6e25271571eb5293 Mon Sep 17 00:00:00 2001 From: Adam Getchell Date: Tue, 5 Nov 2024 13:23:14 -0800 Subject: [PATCH 16/16] ci: revert Coderabbit suggestion [ci skip] --- .github/workflows/macos.yml | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index bc26cecea..8bef77775 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -19,20 +19,12 @@ jobs: - name: Setup run: | # Remove Python symlinks if they exist - declare -a python_files=("2to3" "idle3" "pydoc3" "python3" "python3-config") - declare -a python_versions=("3.11" "3.12") echo "Checking and removing Python symlinks..." - for base in "${python_files[@]}"; do - for version in "${python_versions[@]}"; do - file="/usr/local/bin/${base}${version}" - [ -L "$file" ] && sudo rm "$file" || true - done + for file in \ + /usr/local/bin/{2to3,idle3,pydoc3,python3,python3-config}{,-3.11,-3.12}; do + [ -L "$file" ] && sudo rm "$file" || true done echo "Python symlink cleanup completed." -# for file in \ -# /usr/local/bin/{2to3,idle3,pydoc3,python3,python3-config}{,-3.11,-3.12}; do -# [ -L "$file" ] && sudo rm "$file" || true -# done brew install automake autoconf autoconf-archive libtool texinfo yasm ninja python ccache pkg-config - name: Restore artifacts or setup vcpkg