mirror of
https://github.com/CLIUtils/CLI11.git
synced 2025-04-30 04:33:53 +00:00
fix: some GCC warnings and update codecov (#813)
* add some warning for GCC output * fix some warnings * style: pre-commit.ci fixes * update ubuntu image used for cmake tests so it doesn't auto transition to 22.04 * try a few more warning flags * install the correct files * style: pre-commit.ci fixes * fix install files * add a few more things to pre-commit * try a fix for codacy * another try at codecov * more coverage tweaks Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
This commit is contained in:
parent
71755e4f67
commit
75b19db1d8
@ -1,3 +1,6 @@
|
||||
ignore:
|
||||
- "tests"
|
||||
- "examples"
|
||||
- "book"
|
||||
- "docs"
|
||||
- "test_package"
|
||||
|
2
.github/actions/quick_cmake/action.yml
vendored
2
.github/actions/quick_cmake/action.yml
vendored
@ -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: |
|
||||
|
7
.github/workflows/tests.yml
vendored
7
.github/workflows/tests.yml
vendored
@ -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
|
||||
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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 {
|
||||
|
@ -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()
|
||||
|
Loading…
x
Reference in New Issue
Block a user