Skip to content

Commit

Permalink
Adapted to be more in my style
Browse files Browse the repository at this point in the history
  • Loading branch information
meintte committed May 30, 2023
1 parent 9bb9b40 commit 427526f
Show file tree
Hide file tree
Showing 23 changed files with 234 additions and 1,000 deletions.
98 changes: 4 additions & 94 deletions .clang-format
Original file line number Diff line number Diff line change
@@ -1,98 +1,8 @@
AccessModifierOffset: -2
AlignAfterOpenBracket: DontAlign
AlignConsecutiveAssignments: false
AlignConsecutiveDeclarations: false
AlignEscapedNewlines: Left
AlignOperands: true
AlignTrailingComments: false
AllowAllParametersOfDeclarationOnNextLine: false
AllowShortBlocksOnASingleLine: true
AllowShortCaseLabelsOnASingleLine: false
AllowShortFunctionsOnASingleLine: All
AllowShortIfStatementsOnASingleLine: true
AllowShortLoopsOnASingleLine: true
AlwaysBreakAfterDefinitionReturnType: None
AlwaysBreakAfterReturnType: None
AlwaysBreakBeforeMultilineStrings: true
AlwaysBreakTemplateDeclarations: false
BinPackArguments: false
BinPackParameters: false
BraceWrapping:
AfterClass: true
AfterControlStatement: false
AfterEnum: false
AfterFunction: true
AfterNamespace: false
AfterObjCDeclaration: false
AfterStruct: true
AfterUnion: false
BeforeCatch: false
BeforeElse: false
IndentBraces: false
SplitEmptyFunction: false
SplitEmptyNamespace: true
SplitEmptyRecord: true
BreakAfterJavaFieldAnnotations: true
BreakBeforeBinaryOperators: NonAssignment
BreakBeforeBraces: Custom
BreakBeforeInheritanceComma: true
BreakBeforeTernaryOperators: true
BreakConstructorInitializers: BeforeColon
BreakConstructorInitializersBeforeComma: false
BreakStringLiterals: true
ColumnLimit: 120
CommentPragmas: '^ IWYU pragma:'
CompactNamespaces: false
ConstructorInitializerAllOnOneLineOrOnePerLine: false
ConstructorInitializerIndentWidth: 2
ContinuationIndentWidth: 2
Cpp11BracedListStyle: false
DerivePointerAlignment: false
DisableFormat: false
ExperimentalAutoDetectBinPacking: true
FixNamespaceComments: true
ForEachMacros:
- foreach
- Q_FOREACH
- BOOST_FOREACH
IncludeCategories:
- Priority: 2
Regex: ^"(llvm|llvm-c|clang|clang-c)/
- Priority: 3
Regex: ^(<|"(gtest|gmock|isl|json)/)
- Priority: 1
Regex: .*
IncludeIsMainRegex: (Test)?$
IndentCaseLabels: false
IndentWidth: 2
IndentWrappedFunctionNames: true
JavaScriptQuotes: Leave
JavaScriptWrapImports: true
KeepEmptyLinesAtTheStartOfBlocks: true
BasedOnStyle: Google
IndentWidth: 4
AccessModifierOffset: -4
Language: Cpp
MacroBlockBegin: ''
MacroBlockEnd: ''
MaxEmptyLinesToKeep: 2
NamespaceIndentation: Inner
ObjCBlockIndentWidth: 7
ObjCSpaceAfterProperty: true
ObjCSpaceBeforeProtocolList: false
PointerAlignment: Right
ReflowComments: true
SortIncludes: true
SortUsingDeclarations: false
SpaceAfterCStyleCast: false
SpaceAfterTemplateKeyword: false
SpaceBeforeAssignmentOperators: true
SpaceBeforeParens: ControlStatements
SpaceInEmptyParentheses: false
SpacesBeforeTrailingComments: 0
SpacesInAngles: false
SpacesInCStyleCastParentheses: false
SpacesInContainerLiterals: true
SpacesInParentheses: false
SpacesInSquareBrackets: false
Standard: c++20
TabWidth: 8
TabWidth: 4
UseTab: Never

43 changes: 19 additions & 24 deletions .clang-tidy
Original file line number Diff line number Diff line change
@@ -1,30 +1,25 @@
---
Checks: "*,
-abseil-*,
-altera-*,
-android-*,
-fuchsia-*,
-google-*,
-llvm*,
-modernize-use-trailing-return-type,
-zircon-*,
-readability-else-after-return,
-readability-static-accessed-through-instance,
-readability-avoid-const-params-in-decls,
-cppcoreguidelines-non-private-member-variables-in-classes,
-misc-non-private-member-variables-in-classes,
"
WarningsAsErrors: ''
HeaderFilterRegex: ''
FormatStyle: none
-abseil-*,
-altera-*,
-android-*,
-fuchsia-*,
-google-*,
-llvm*,
-modernize-use-trailing-return-type,
-zircon-*,
-readability-else-after-return,
-readability-static-accessed-through-instance,
-readability-avoid-const-params-in-decls,
-cppcoreguidelines-non-private-member-variables-in-classes,
-misc-non-private-member-variables-in-classes"

WarningsAsErrors: ""
HeaderFilterRegex: ""
FormatStyle: none

CheckOptions:
- key: readability-identifier-length.IgnoredVariableNames
value: 'x|y|z'
value: "x|y|z"
- key: readability-identifier-length.IgnoredParameterNames
value: 'x|y|z'





value: "x|y|z"
10 changes: 4 additions & 6 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ cmake_minimum_required(VERSION 3.21)
# manual dependency management

# Only set the cxx_standard if it is not set by someone else
if (NOT DEFINED CMAKE_CXX_STANDARD)
if(NOT DEFINED CMAKE_CXX_STANDARD)
set(CMAKE_CXX_STANDARD 20)
endif()

Expand All @@ -25,7 +25,6 @@ project(
include(cmake/PreventInSourceBuilds.cmake)
include(ProjectOptions.cmake)


myproject_setup_options()

myproject_global_options()
Expand Down Expand Up @@ -73,10 +72,9 @@ if(BUILD_TESTING)
add_subdirectory(test)
endif()


if(myproject_BUILD_FUZZ_TESTS)
message(AUTHOR_WARNING "Building Fuzz Tests, using fuzzing sanitizer https://www.llvm.org/docs/LibFuzzer.html")
if (NOT myproject_ENABLE_ADDRESS_SANITIZER AND NOT myproject_ENABLE_THREAD_SANITIZER)
if(NOT myproject_ENABLE_ADDRESS_SANITIZER AND NOT myproject_ENABLE_THREAD_SANITIZER)
message(WARNING "You need asan or tsan enabled for meaningful fuzz testing")
endif()
add_subdirectory(fuzz_test)
Expand All @@ -92,7 +90,7 @@ if(MSVC)
endif()

# set the startup project for the "play" button in MSVC
set_property(DIRECTORY PROPERTY VS_STARTUP_PROJECT intro)
set_property(DIRECTORY PROPERTY VS_STARTUP_PROJECT app)

if(CMAKE_SKIP_INSTALL_RULES)
return()
Expand All @@ -104,7 +102,7 @@ include(cmake/PackageProject.cmake)
# we know we want to ship
myproject_package_project(
TARGETS
intro
app
myproject_options
myproject_warnings
# FIXME: this does not work! CK
Expand Down
17 changes: 11 additions & 6 deletions Dependencies.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,17 @@ function(myproject_setup_dependencies)
cpmaddpackage("gh:CLIUtils/CLI11@2.3.2")
endif()

if(NOT TARGET ftxui::screen)
cpmaddpackage("gh:ArthurSonzogni/FTXUI#e23dbc7473654024852ede60e2121276c5aab660")
endif()

if(NOT TARGET tools::tools)
cpmaddpackage("gh:lefticus/tools#update_build_system")
if(NOT TARGET Eigen3::Eigen)
cpmaddpackage(
GITLAB_REPOSITORY
"libeigen/eigen"
GIT_TAG
"3.4.0"
OPTIONS
"EIGEN_BUILD_DOC NO"
"EIGEN_LEAVE_TEST_IN_ALL_TARGET YES"
"BUILD_TESTING NO"
"EIGEN_BUILD_PKGCONFIG NO")
endif()

endfunction()
5 changes: 1 addition & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,7 @@

## About cmake_template

**NOTE** This is undergoing a major overhaul on a new branch currently.


This is a C++ Best Practices GitHub template for getting up and running with C++ quickly.
This is a C++ Best Practices GitHub template fork for getting up and running with C++ quickly.

By default (collectively known as `ENABLE_DEVELOPER_MODE`)

Expand Down
Loading

0 comments on commit 427526f

Please sign in to comment.