-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
introduce bitmask support and std::format specialization
- Loading branch information
Showing
23 changed files
with
2,229 additions
and
814 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
*out | ||
*logs | ||
*actions | ||
*notifications | ||
*tools | ||
plugins | ||
user_trunk.yaml | ||
user.yaml | ||
tmp |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
Checks: >- | ||
bugprone-*, | ||
cppcoreguidelines-*, | ||
google-*, | ||
misc-*, | ||
modernize-*, | ||
performance-*, | ||
readability-*, | ||
-bugprone-lambda-function-name, | ||
-bugprone-reserved-identifier, | ||
-cppcoreguidelines-avoid-goto, | ||
-cppcoreguidelines-avoid-magic-numbers, | ||
-cppcoreguidelines-avoid-non-const-global-variables, | ||
-cppcoreguidelines-pro-bounds-array-to-pointer-decay, | ||
-cppcoreguidelines-pro-type-vararg, | ||
-google-readability-braces-around-statements, | ||
-google-readability-function-size, | ||
-misc-no-recursion, | ||
-modernize-return-braced-init-list, | ||
-modernize-use-nodiscard, | ||
-modernize-use-trailing-return-type, | ||
-performance-unnecessary-value-param, | ||
-readability-magic-numbers, | ||
CheckOptions: | ||
- key: readability-function-cognitive-complexity.Threshold | ||
value: 100 | ||
- key: readability-function-cognitive-complexity.IgnoreMacros | ||
value: true | ||
# Set naming conventions for your style below (there are dozens of naming settings possible): | ||
# See https://clang.llvm.org/extra/clang-tidy/checks/readability/identifier-naming.html | ||
# - key: readability-identifier-naming.ClassCase | ||
# value: CamelCase | ||
# - key: readability-identifier-naming.NamespaceCase | ||
# value: lower_case | ||
# - key: readability-identifier-naming.PrivateMemberSuffix | ||
# value: _ | ||
# - key: readability-identifier-naming.StructCase | ||
# value: CamelCase |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
# Prettier friendly markdownlint config (all formatting rules disabled) | ||
extends: markdownlint/style/prettier |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
enable=all | ||
source-path=SCRIPTDIR | ||
disable=SC2154 | ||
|
||
# If you're having issues with shellcheck following source, disable the errors via: | ||
# disable=SC1090 | ||
# disable=SC1091 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
rules: | ||
quoted-strings: | ||
required: only-when-needed | ||
extra-allowed: ["{|}"] | ||
key-duplicates: {} | ||
octal-values: | ||
forbid-implicit-octal: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
# This file controls the behavior of Trunk: https://docs.trunk.io/cli | ||
# To learn more about the format of this file, see https://docs.trunk.io/reference/trunk-yaml | ||
version: 0.1 | ||
cli: | ||
version: 1.22.1 | ||
# Trunk provides extensibility via plugins. (https://docs.trunk.io/plugins) | ||
plugins: | ||
sources: | ||
- id: trunk | ||
ref: v1.5.0 | ||
uri: https://github.com/trunk-io/plugins | ||
# Many linters and tools depend on runtimes - configure them here. (https://docs.trunk.io/runtimes) | ||
runtimes: | ||
enabled: | ||
- [email protected] | ||
- [email protected] | ||
- [email protected] | ||
# This is the section where you manage your linters. (https://docs.trunk.io/check/configuration) | ||
lint: | ||
enabled: | ||
- [email protected] | ||
- [email protected] | ||
- [email protected] | ||
- [email protected] | ||
- [email protected] | ||
- git-diff-check | ||
- [email protected] | ||
- [email protected] | ||
- [email protected] | ||
- [email protected] | ||
- [email protected] | ||
- [email protected] | ||
- [email protected] | ||
actions: | ||
disabled: | ||
- trunk-announce | ||
- trunk-check-pre-push | ||
- trunk-fmt-pre-commit | ||
enabled: | ||
- trunk-upgrade-available |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,16 @@ | ||
{ | ||
"files.associations": { | ||
"cmath": "cpp", | ||
"string_view": "cpp" | ||
} | ||
"files.associations": { | ||
"cmath": "cpp", | ||
"string_view": "cpp", | ||
"sstream": "cpp", | ||
"optional": "cpp", | ||
"memory": "cpp", | ||
"random": "cpp", | ||
"array": "cpp", | ||
"fstream": "cpp", | ||
"tuple": "cpp", | ||
"type_traits": "cpp", | ||
"system_error": "cpp" | ||
}, | ||
"cmake.generator": "Unix Makefiles" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,95 @@ | ||
cmake_minimum_required(VERSION 3.14) | ||
project(enum_name_example VERSION 0.1 LANGUAGES CXX) | ||
|
||
set(CMAKE_CXX_STANDARD 17) | ||
project( | ||
enum_name | ||
VERSION 1.0 | ||
LANGUAGES CXX) | ||
|
||
include(FetchContent) | ||
# Define the library | ||
add_library(enum_name INTERFACE) | ||
add_library(mgutility::${PROJECT_NAME} ALIAS ${PROJECT_NAME}) | ||
|
||
FetchContent_Declare( | ||
DocTest | ||
GIT_REPOSITORY "https://github.com/onqtam/doctest" | ||
GIT_TAG "v2.4.11" | ||
) | ||
# Specify the include directories for the library | ||
target_include_directories( | ||
enum_name INTERFACE $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include> | ||
$<INSTALL_INTERFACE:include>) | ||
|
||
FetchContent_MakeAvailable(DocTest) | ||
# Set the C++ standard | ||
target_compile_features(enum_name INTERFACE cxx_std_11) | ||
|
||
add_executable(${PROJECT_NAME} example/main.cpp) | ||
target_include_directories(${PROJECT_NAME} PUBLIC ${CMAKE_SOURCE_DIR}/include) | ||
if(CMAKE_SYSTEM_NAME STREQUAL Linux) | ||
include(GNUInstallDirs) | ||
set(include_install_dir ${CMAKE_INSTALL_INCLUDEDIR}) | ||
set(config_install_dir "${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME}") | ||
else() | ||
set(include_install_dir "include") | ||
set(config_install_dir "lib/cmake/${PROJECT_NAME}") | ||
endif() | ||
|
||
enable_testing() | ||
add_subdirectory(test) | ||
# Create the package configuration files | ||
include(CMakePackageConfigHelpers) | ||
|
||
write_basic_package_version_file( | ||
"${CMAKE_CURRENT_BINARY_DIR}/enum_nameConfigVersion.cmake" | ||
VERSION ${PROJECT_VERSION} | ||
COMPATIBILITY AnyNewerVersion) | ||
|
||
configure_package_config_file( | ||
${CMAKE_CURRENT_LIST_DIR}/cmake/enum_nameConfig.cmake.in | ||
"${CMAKE_CURRENT_BINARY_DIR}/enum_nameConfig.cmake" | ||
INSTALL_DESTINATION lib/cmake/enum_name) | ||
|
||
if(NOT ${ENUM_NAME_NO_INSTALL}) | ||
# Install the library | ||
install( | ||
TARGETS enum_name | ||
EXPORT enum_nameTargets | ||
INCLUDES | ||
DESTINATION include) | ||
|
||
install( | ||
EXPORT enum_nameTargets | ||
FILE enum_nameTargets.cmake | ||
NAMESPACE mgutility:: | ||
DESTINATION lib/cmake/enum_name) | ||
|
||
install(DIRECTORY include/ DESTINATION include) | ||
|
||
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/enum_nameConfig.cmake" | ||
"${CMAKE_CURRENT_BINARY_DIR}/enum_nameConfigVersion.cmake" | ||
DESTINATION lib/cmake/enum_name) | ||
|
||
export( | ||
EXPORT enum_nameTargets | ||
FILE "${CMAKE_CURRENT_BINARY_DIR}/enum_nameTargets.cmake" | ||
NAMESPACE mgutility::) | ||
endif() | ||
|
||
# Add example executable | ||
add_executable(example_enum_name example/main.cpp) | ||
|
||
# Link the example executable with the library | ||
target_link_libraries(example_enum_name PRIVATE mgutility::enum_name) | ||
|
||
if(NOT ${ENUM_NAME_NO_TESTS}) | ||
# Enable testing | ||
enable_testing() | ||
|
||
# FetchContent to get the Doctest testing framework | ||
include(FetchContent) | ||
FetchContent_Declare( | ||
doctest | ||
GIT_REPOSITORY https://github.com/doctest/doctest.git | ||
GIT_TAG v2.4.11) | ||
FetchContent_MakeAvailable(doctest) | ||
|
||
# Add test executable | ||
add_executable(test_enum_name tests/test_enum_name.cpp) | ||
|
||
# Link the test executable with the library and Doctest | ||
target_link_libraries(test_enum_name PRIVATE mgutility::enum_name | ||
doctest::doctest) | ||
|
||
# Add tests | ||
add_test(NAME test_enum_name COMMAND test_enum_name) | ||
endif() |
Oops, something went wrong.