diff --git a/.codecov.yml b/.codecov.yml index 185bbad3f..2664e71ab 100644 --- a/.codecov.yml +++ b/.codecov.yml @@ -1,3 +1,6 @@ ignore: - "tests" - "examples" + - "book" + - "docs" + - "test_package" diff --git a/.github/actions/quick_cmake/action.yml b/.github/actions/quick_cmake/action.yml index 811f73fe2..8359fb0d0 100644 --- a/.github/actions/quick_cmake/action.yml +++ b/.github/actions/quick_cmake/action.yml @@ -13,7 +13,7 @@ runs: using: composite steps: - name: CMake ${{ inputs.cmake-version }} - uses: jwlawson/actions-setup-cmake@v1.12 + uses: jwlawson/actions-setup-cmake@v1.13 with: cmake-version: "${{ inputs.cmake-version }}" - run: | diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index febc8130b..cfc7938d9 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -48,14 +48,15 @@ jobs: - name: Prepare coverage run: | lcov --directory . --capture --output-file coverage.info - lcov --remove coverage.info '*/tests/*' '*/examples/*' '/usr/*' --output-file coverage.info + lcov --remove coverage.info '*/tests/*' '*/examples/*' '/usr/*' '*/book/*' --output-file coverage.info lcov --list coverage.info working-directory: build - uses: codecov/codecov-action@v3 with: + files: build/coverage.info fail_ci_if_error: true - working-directory: build + functionalities: fixes clang-tidy: name: Clang-Tidy @@ -129,7 +130,7 @@ jobs: cmake-config: name: CMake config check - runs-on: ubuntu-latest + runs-on: ubuntu-20.04 steps: - uses: actions/checkout@v3 diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 14d633d9c..425885bdb 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -16,9 +16,13 @@ repos: - id: check-merge-conflict - id: check-symlinks - id: check-yaml + - id: check-toml - id: end-of-file-fixer - id: mixed-line-ending - id: trailing-whitespace + - id: check-shebang-scripts-are-executable + - id: check-executables-have-shebangs + - id: debug-statements - repo: https://github.com/pre-commit/mirrors-clang-format rev: v15.0.4 diff --git a/azure-pipelines.yml b/azure-pipelines.yml index d9e448723..24576eb4f 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -110,13 +110,14 @@ jobs: gcc11: containerImage: gcc:11 cli11.std: 20 - gcc8: - containerImage: gcc:8 - cli11.std: 17 + cli11.options: -DCMAKE_CXX_FLAGS="-Wredundant-decls -Wconversion" + gcc7: + containerImage: gcc:7 + cli11.std: 14 + cli11.options: -DCMAKE_CXX_FLAGS="-Wconversion" gcc4.8: containerImage: helics/buildenv:gcc4-8-builder cli11.std: 11 - cli11.options: clang3.4: containerImage: silkeh/clang:3.4 cli11.std: 11 diff --git a/include/CLI/App.hpp b/include/CLI/App.hpp index d29aa6a89..a1d2c2704 100644 --- a/include/CLI/App.hpp +++ b/include/CLI/App.hpp @@ -49,8 +49,11 @@ struct AppFriend; } // namespace detail namespace FailureMessage { -std::string simple(const App *app, const Error &e); -std::string help(const App *app, const Error &e); +/// Printout a clean, simple message on error (the default in CLI11 1.5+) +CLI11_INLINE std::string simple(const App *app, const Error &e); + +/// Printout the full help string on error (if this fn is set, the old default for CLI11) +CLI11_INLINE std::string help(const App *app, const Error &e); } // namespace FailureMessage /// enumeration of modes of how to deal with extras in config files @@ -1352,16 +1355,6 @@ CLI11_INLINE void retire_option(App *app, const std::string &option_name); /// Helper function to mark an option as retired CLI11_INLINE void retire_option(App &app, const std::string &option_name); -namespace FailureMessage { - -/// Printout a clean, simple message on error (the default in CLI11 1.5+) -CLI11_INLINE std::string simple(const App *app, const Error &e); - -/// Printout the full help string on error (if this fn is set, the old default for CLI11) -CLI11_INLINE std::string help(const App *app, const Error &e); - -} // namespace FailureMessage - namespace detail { /// This class is simply to allow tests access to App's protected functions struct AppFriend { diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 341cae42c..9409b86ca 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -2,7 +2,6 @@ set(CLI11_headerLoc "${PROJECT_SOURCE_DIR}/include/CLI") set(CLI11_headers ${CLI11_headerLoc}/App.hpp - ${CLI11_headerLoc}/CLI.hpp ${CLI11_headerLoc}/Config.hpp ${CLI11_headerLoc}/ConfigFwd.hpp ${CLI11_headerLoc}/Error.hpp @@ -12,7 +11,6 @@ set(CLI11_headers ${CLI11_headerLoc}/Option.hpp ${CLI11_headerLoc}/Split.hpp ${CLI11_headerLoc}/StringTools.hpp - ${CLI11_headerLoc}/Timer.hpp ${CLI11_headerLoc}/TypeTools.hpp ${CLI11_headerLoc}/Validators.hpp ${CLI11_headerLoc}/Version.hpp) @@ -28,10 +26,13 @@ set(CLI11_impl_headers ${CLI11_implLoc}/StringTools_inl.hpp ${CLI11_implLoc}/Validators_inl.hpp) +set(CLI11_library_headers ${CLI11_headerLoc}/CLI.hpp ${CLI11_headerLoc}/Timer.hpp) + if(CLI11_PRECOMPILED) # Create static lib file(GLOB CLI11_precompile_sources "${PROJECT_SOURCE_DIR}/src/*.cpp") - add_library(CLI11 STATIC ${CLI11_headers} ${CLI11_impl_headers} ${CLI11_precompile_sources}) + add_library(CLI11 STATIC ${CLI11_headers} ${CLI11_library_headers} ${CLI11_impl_headers} + ${CLI11_precompile_sources}) target_compile_definitions(CLI11 PUBLIC -DCLI11_COMPILE) set(PUBLIC_OR_INTERFACE PUBLIC) @@ -39,7 +40,7 @@ else() add_library(CLI11 INTERFACE) if(CMAKE_VERSION VERSION_GREATER 3.19) # This is only useful for visual studio and other IDE builds - target_sources(CLI11 PRIVATE ${CLI11_headers} ${CLI11_impl_headers}) + target_sources(CLI11 PRIVATE ${CLI11_headers} ${CLI11_library_headers} ${CLI11_impl_headers}) endif() set(PUBLIC_OR_INTERFACE INTERFACE) @@ -112,7 +113,8 @@ if(CLI11_INSTALL) # Make an export target install(TARGETS CLI11 EXPORT CLI11Targets) if(NOT CLI11_SINGLE_FILE) - install(FILES ${CLI11_headers} DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/CLI") + install(FILES ${CLI11_headers} ${CLI11_library_headers} + DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/CLI") if(NOT CLI11_COMPILE) install(FILES ${CLI11_impl_headers} DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/CLI/impl") endif()