Skip to content

Commit

Permalink
project-wide refactoring
Browse files Browse the repository at this point in the history
- moved implementation-only headers to `/impl`
- replaced `[[nodiscard]]` with `TOML_NODISCARD`
- added `.clang-format` + applied to all files

also:
- added support for Unicode 14.0
- fixed minor documentation issues
- version bump (pre-emptive for next release)
  • Loading branch information
marzer committed Oct 23, 2021
1 parent fe28ec8 commit ca76e5d
Show file tree
Hide file tree
Showing 53 changed files with 21,210 additions and 19,773 deletions.
10 changes: 5 additions & 5 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ jobs:
resource_class: large
steps:
- checkout
- run:
name: Installing dependencies
command: |
pip3 install --upgrade -r tools/requirements.txt
- run:
name: Checking toml.hpp
command: |
Expand All @@ -28,10 +32,6 @@ jobs:
resource_class: large
steps:
- checkout
- run:
name: Checking toml.hpp
command: |
cd tools && python3 ci_single_header_check.py
- run:
name: Pulling submodules
command: |
Expand Down Expand Up @@ -83,7 +83,7 @@ jobs:
- run:
name: Installing dependencies
command: |
pip3 install -r tools/requirements.txt
pip3 install --upgrade -r tools/requirements.txt
- run:
name: Generating documentation
command: |
Expand Down
185 changes: 185 additions & 0 deletions .clang-format
Original file line number Diff line number Diff line change
@@ -0,0 +1,185 @@
---
Language: Cpp
AccessModifierOffset: -2
AlignAfterOpenBracket: Align
AlignConsecutiveMacros: Consecutive
AlignConsecutiveAssignments: Consecutive
AlignConsecutiveBitFields: Consecutive
AlignConsecutiveDeclarations: None
AlignEscapedNewlines: Right
AlignOperands: AlignAfterOperator
AlignTrailingComments: true
AllowAllArgumentsOnNextLine: false
AllowAllConstructorInitializersOnNextLine: false
AllowAllParametersOfDeclarationOnNextLine: false
AllowShortEnumsOnASingleLine: false
AllowShortBlocksOnASingleLine: Never
AllowShortCaseLabelsOnASingleLine: true
AllowShortFunctionsOnASingleLine: None
AllowShortLambdasOnASingleLine: All
AllowShortIfStatementsOnASingleLine: Never
AllowShortLoopsOnASingleLine: false
AlwaysBreakAfterDefinitionReturnType: None
AlwaysBreakAfterReturnType: None
AlwaysBreakBeforeMultilineStrings: false
AlwaysBreakTemplateDeclarations: Yes
AttributeMacros:
- TOML_ABSTRACT_BASE
- TOML_EMPTY_BASES
- TOML_TRIVIAL_ABI
BinPackArguments: false
BinPackParameters: false
BraceWrapping:
AfterCaseLabel: true
AfterClass: true
AfterControlStatement: Always
AfterEnum: true
AfterFunction: true
AfterNamespace: true
AfterObjCDeclaration: false
AfterStruct: true
AfterUnion: true
AfterExternBlock: true
BeforeCatch: true
BeforeElse: true
BeforeLambdaBody: true
BeforeWhile: true
IndentBraces: false
SplitEmptyFunction: false
SplitEmptyRecord: false
SplitEmptyNamespace: true
BreakBeforeBinaryOperators: NonAssignment
BreakBeforeConceptDeclarations: true
BreakBeforeBraces: Custom
BreakBeforeInheritanceComma: false
BreakInheritanceList: BeforeColon
BreakBeforeTernaryOperators: true
BreakConstructorInitializersBeforeComma: false
BreakConstructorInitializers: BeforeColon
BreakAfterJavaFieldAnnotations: false
BreakStringLiterals: true
ColumnLimit: 120
CommentPragmas: '^([/*!#]|\s*(===|---|clang-format))'
CompactNamespaces: false
ConstructorInitializerAllOnOneLineOrOnePerLine: true
ConstructorInitializerIndentWidth: 4
ContinuationIndentWidth: 4
Cpp11BracedListStyle: false
DeriveLineEnding: false
DerivePointerAlignment: false
DisableFormat: false
EmptyLineBeforeAccessModifier: LogicalBlock
ExperimentalAutoDetectBinPacking: false
FixNamespaceComments: false
ForEachMacros:
- foreach
- Q_FOREACH
- BOOST_FOREACH
StatementAttributeLikeMacros:
- Q_EMIT
IncludeBlocks: Preserve
IncludeCategories:
- Regex: '^"(llvm|llvm-c|clang|clang-c)/'
Priority: 2
SortPriority: 0
CaseSensitive: false
- Regex: '^(<|"(gtest|gmock|isl|json)/)'
Priority: 3
SortPriority: 0
CaseSensitive: false
- Regex: '.*'
Priority: 1
SortPriority: 0
CaseSensitive: false
IncludeIsMainRegex: '(Test)?$'
IncludeIsMainSourceRegex: ''
IndentCaseLabels: true
IndentCaseBlocks: false
IndentGotoLabels: true
IndentPPDirectives: BeforeHash
IndentExternBlock: Indent
IndentRequires: false
IndentWidth: 4
IndentWrappedFunctionNames: false
InsertTrailingCommas: None
JavaScriptQuotes: Leave
JavaScriptWrapImports: true
KeepEmptyLinesAtTheStartOfBlocks: false
MacroBlockBegin: ''
MacroBlockEnd: ''
MaxEmptyLinesToKeep: 1
NamespaceIndentation: All
ObjCBinPackProtocolList: Auto
ObjCBlockIndentWidth: 2
ObjCBreakBeforeNestedBlockParam: true
ObjCSpaceAfterProperty: false
ObjCSpaceBeforeProtocolList: true
PenaltyBreakAssignment: 2
PenaltyBreakBeforeFirstCallParameter: 19
PenaltyBreakComment: 1
PenaltyBreakFirstLessLess: 120
PenaltyBreakString: 1000
PenaltyBreakTemplateDeclaration: 10
PenaltyExcessCharacter: 1000000
PenaltyReturnTypeOnItsOwnLine: 1000000
PenaltyIndentedWhitespace: 0
PointerAlignment: Left
ReflowComments: true
SortIncludes: false
SortJavaStaticImport: Before
SortUsingDeclarations: false
SpaceAfterCStyleCast: false
SpaceAfterLogicalNot: false
SpaceAfterTemplateKeyword: true
SpaceBeforeAssignmentOperators: true
SpaceBeforeCaseColon: false
SpaceBeforeCpp11BracedList: false
SpaceBeforeCtorInitializerColon: true
SpaceBeforeInheritanceColon: true
SpaceBeforeParens: ControlStatements
SpaceAroundPointerQualifiers: Default
SpaceBeforeRangeBasedForLoopColon: true
SpaceInEmptyBlock: false
SpaceInEmptyParentheses: false
SpacesBeforeTrailingComments: 1
SpacesInAngles: false
SpacesInConditionalStatement: false
SpacesInContainerLiterals: true
SpacesInCStyleCastParentheses: false
SpacesInParentheses: false
SpacesInSquareBrackets: false
SpaceBeforeSquareBrackets: false
BitFieldColonSpacing: Both
Standard: Latest
StatementMacros:
- TOML_ALWAYS_INLINE
- TOML_API
- TOML_ATTR
- TOML_CONSTEVAL
- TOML_EXTERNAL_LINKAGE
- TOML_INTERNAL_LINKAGE
- TOML_MEMBER_ATTR
- TOML_NEVER_INLINE
- TOML_NODISCARD
- TOML_NODISCARD_CTOR
- TOML_RETURNS_BY_THROWING
TabWidth: 4
TypenameMacros:
UseCRLF: false
UseTab: Always
WhitespaceSensitiveMacros:
- STRINGIZE
- PP_STRINGIZE
- BOOST_PP_STRINGIZE
- TOML_ATTR
- TOML_CONCAT
- TOML_LIKELY
- TOML_MAKE_RAW_STRING
- TOML_MAKE_STRING
- TOML_MAKE_STRING_VIEW
- TOML_PRAGMA_CLANG
- TOML_PRAGMA_GCC
- TOML_PRAGMA_MSVC
- TOML_UNLIKELY
...

2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ cmake_minimum_required(VERSION 3.14)

project(
tomlplusplus
VERSION 2.5.0
VERSION 2.6.0
DESCRIPTION "Header-only TOML config file parser and serializer for C++17 (and later!)"
HOMEPAGE_URL "https://marzer.github.io/tomlplusplus/"
LANGUAGES CXX
Expand Down
6 changes: 4 additions & 2 deletions cpp.hint
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,10 @@
#define TOML_EMPTY_BASES
#define TOML_MAY_THROW
#define TOML_CONSTEVAL constexpr
#define TOML_LIKELY(...) (__VA_ARGS__)
#define TOML_UNLIKELY(...) (__VA_ARGS__)
#define TOML_CONSTRAINED_TEMPLATE(condition, ...) template <__VA_ARGS__>
#define TOML_LIKELY(...) (__VA_ARGS__)
#define TOML_UNLIKELY(...) (__VA_ARGS__)
#define TOML_NODISCARD
#define TOML_NODISCARD_CTOR
#define TOML_EXTERNAL_LINKAGE
#define TOML_INTERNAL_LINKAGE
Loading

0 comments on commit ca76e5d

Please sign in to comment.