-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Fix order deps. * Squashed '3rd-party/json/' content from commit bc889afb git-subtree-dir: 3rd-party/json git-subtree-split: bc889afb4c5bf1c0d8ee29ef35eaaf4c8bef8a5d * Upgrade JSON complete, tests pass. * Pull SONATA to Arbor 0.9 - use nlohmann directly - modernise API - excise warnings - abstract over JSON - isolate failing tests against order dependency
- Loading branch information
1 parent
27d68cb
commit 253d353
Showing
1,079 changed files
with
179,415 additions
and
147 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,84 @@ | ||
#AccessModifierOffset: 2 | ||
AlignAfterOpenBracket: Align | ||
AlignConsecutiveAssignments: false | ||
#AlignConsecutiveBitFields: false | ||
AlignConsecutiveDeclarations: false | ||
AlignConsecutiveMacros: false | ||
AlignEscapedNewlines: Right | ||
#AlignOperands: AlignAfterOperator | ||
AlignTrailingComments: true | ||
AllowAllArgumentsOnNextLine: false | ||
AllowAllConstructorInitializersOnNextLine: false | ||
AllowAllParametersOfDeclarationOnNextLine: false | ||
AllowShortBlocksOnASingleLine: Empty | ||
AllowShortCaseLabelsOnASingleLine: false | ||
#AllowShortEnumsOnASingleLine: true | ||
AllowShortFunctionsOnASingleLine: Empty | ||
AllowShortIfStatementsOnASingleLine: Never | ||
AllowShortLambdasOnASingleLine: Empty | ||
AllowShortLoopsOnASingleLine: false | ||
AlwaysBreakAfterReturnType: None | ||
AlwaysBreakBeforeMultilineStrings: false | ||
AlwaysBreakTemplateDeclarations: Yes | ||
BinPackArguments: false | ||
BinPackParameters: false | ||
#BitFieldColonSpacing: Both | ||
BreakBeforeBraces: Custom # or Allman | ||
BraceWrapping: | ||
AfterCaseLabel: true | ||
AfterClass: true | ||
AfterControlStatement: Always | ||
AfterEnum: true | ||
AfterFunction: true | ||
AfterNamespace: false | ||
AfterStruct: true | ||
AfterUnion: true | ||
AfterExternBlock: false | ||
BeforeCatch: true | ||
BeforeElse: true | ||
#BeforeLambdaBody: false | ||
#BeforeWhile: false | ||
SplitEmptyFunction: false | ||
SplitEmptyRecord: false | ||
SplitEmptyNamespace: false | ||
BreakBeforeTernaryOperators: true | ||
BreakConstructorInitializers: BeforeComma | ||
BreakStringLiterals: false | ||
ColumnLimit: 0 | ||
CompactNamespaces: false | ||
ConstructorInitializerIndentWidth: 2 | ||
Cpp11BracedListStyle: true | ||
PointerAlignment: Left | ||
FixNamespaceComments: true | ||
IncludeBlocks: Preserve | ||
#IndentCaseBlocks: false | ||
IndentCaseLabels: true | ||
IndentGotoLabels: false | ||
IndentPPDirectives: BeforeHash | ||
IndentWidth: 4 | ||
KeepEmptyLinesAtTheStartOfBlocks: false | ||
MaxEmptyLinesToKeep: 1 | ||
NamespaceIndentation: None | ||
ReflowComments: false | ||
SortIncludes: true | ||
SortUsingDeclarations: true | ||
SpaceAfterCStyleCast: false | ||
SpaceAfterLogicalNot: false | ||
SpaceAfterTemplateKeyword: false | ||
SpaceBeforeAssignmentOperators: true | ||
SpaceBeforeCpp11BracedList: false | ||
SpaceBeforeParens: ControlStatements | ||
SpaceBeforeRangeBasedForLoopColon: true | ||
SpaceBeforeSquareBrackets: false | ||
SpaceInEmptyBlock: false | ||
SpaceInEmptyParentheses: false | ||
SpacesBeforeTrailingComments: 2 | ||
SpacesInAngles: false | ||
SpacesInCStyleCastParentheses: false | ||
SpacesInConditionalStatement: false | ||
SpacesInContainerLiterals: false | ||
SpacesInParentheses: false | ||
SpacesInSquareBrackets: false | ||
Standard: c++11 | ||
TabWidth: 4 | ||
UseTab: Never |
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,56 @@ | ||
Checks: '*, | ||
-altera-id-dependent-backward-branch, | ||
-altera-struct-pack-align, | ||
-altera-unroll-loops, | ||
-android-cloexec-fopen, | ||
-bugprone-easily-swappable-parameters, | ||
-cert-err58-cpp, | ||
-concurrency-mt-unsafe, | ||
-cppcoreguidelines-avoid-goto, | ||
-cppcoreguidelines-avoid-magic-numbers, | ||
-cppcoreguidelines-avoid-non-const-global-variables, | ||
-cppcoreguidelines-macro-usage, | ||
-cppcoreguidelines-pro-bounds-array-to-pointer-decay, | ||
-cppcoreguidelines-pro-bounds-constant-array-index, | ||
-cppcoreguidelines-pro-bounds-pointer-arithmetic, | ||
-cppcoreguidelines-pro-type-reinterpret-cast, | ||
-cppcoreguidelines-pro-type-union-access, | ||
-cppcoreguidelines-virtual-class-destructor, | ||
-fuchsia-default-arguments-calls, | ||
-fuchsia-default-arguments-declarations, | ||
-fuchsia-overloaded-operator, | ||
-google-explicit-constructor, | ||
-google-readability-function-size, | ||
-google-runtime-int, | ||
-google-runtime-references, | ||
-hicpp-avoid-goto, | ||
-hicpp-explicit-conversions, | ||
-hicpp-function-size, | ||
-hicpp-no-array-decay, | ||
-hicpp-no-assembler, | ||
-hicpp-signed-bitwise, | ||
-hicpp-uppercase-literal-suffix, | ||
-llvm-header-guard, | ||
-llvm-include-order, | ||
-llvmlibc-*, | ||
-misc-no-recursion, | ||
-misc-non-private-member-variables-in-classes, | ||
-modernize-concat-nested-namespaces, | ||
-modernize-use-nodiscard, | ||
-modernize-use-trailing-return-type, | ||
-readability-function-cognitive-complexity, | ||
-readability-function-size, | ||
-readability-identifier-length, | ||
-readability-magic-numbers, | ||
-readability-redundant-access-specifiers, | ||
-readability-simplify-boolean-expr, | ||
-readability-uppercase-literal-suffix' | ||
|
||
CheckOptions: | ||
- key: hicpp-special-member-functions.AllowSoleDefaultDtor | ||
value: 1 | ||
|
||
WarningsAsErrors: '*' | ||
|
||
#HeaderFilterRegex: '.*nlohmann.*' | ||
HeaderFilterRegex: '.*hpp$' |
Validating CODEOWNERS rules …
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,6 @@ | ||
# JSON for Modern C++ has been originally written by Niels Lohmann. | ||
# Since 2013 over 140 contributors have helped to improve the library. | ||
# This CODEOWNERS file is only to make sure that @nlohmann is requested | ||
# for a code review in case of a pull request. | ||
|
||
* @nlohmann |
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,46 @@ | ||
# Contributor Covenant Code of Conduct | ||
|
||
## Our Pledge | ||
|
||
In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation. | ||
|
||
## Our Standards | ||
|
||
Examples of behavior that contributes to creating a positive environment include: | ||
|
||
* Using welcoming and inclusive language | ||
* Being respectful of differing viewpoints and experiences | ||
* Gracefully accepting constructive criticism | ||
* Focusing on what is best for the community | ||
* Showing empathy towards other community members | ||
|
||
Examples of unacceptable behavior by participants include: | ||
|
||
* The use of sexualized language or imagery and unwelcome sexual attention or advances | ||
* Trolling, insulting/derogatory comments, and personal or political attacks | ||
* Public or private harassment | ||
* Publishing others' private information, such as a physical or electronic address, without explicit permission | ||
* Other conduct which could reasonably be considered inappropriate in a professional setting | ||
|
||
## Our Responsibilities | ||
|
||
Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior. | ||
|
||
Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful. | ||
|
||
## Scope | ||
|
||
This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers. | ||
|
||
## Enforcement | ||
|
||
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at [email protected]. The project team will review and investigate all complaints, and will respond in a way that it deems appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately. | ||
|
||
Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership. | ||
|
||
## Attribution | ||
|
||
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at [http://contributor-covenant.org/version/1/4][version] | ||
|
||
[homepage]: http://contributor-covenant.org | ||
[version]: http://contributor-covenant.org/version/1/4/ |
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,71 @@ | ||
[![Issue Stats](http://issuestats.com/github/nlohmann/json/badge/pr?style=flat)](http://issuestats.com/github/nlohmann/json) [![Issue Stats](http://issuestats.com/github/nlohmann/json/badge/issue?style=flat)](http://issuestats.com/github/nlohmann/json) | ||
|
||
# How to contribute | ||
|
||
This project started as a little excuse to exercise some of the cool new C++11 features. Over time, people actually started to use the JSON library (yey!) and started to help improve it by proposing features, finding bugs, or even fixing my mistakes. I am really [thankful](https://github.com/nlohmann/json/blob/master/README.md#thanks) for this and try to keep track of all the helpers. | ||
|
||
To make it as easy as possible for you to contribute and for me to keep an overview, here are a few guidelines which should help us avoid all kinds of unnecessary work or disappointment. And of course, this document is subject to discussion, so please [create an issue](https://github.com/nlohmann/json/issues/new/choose) or a pull request if you find a way to improve it! | ||
|
||
## Private reports | ||
|
||
Usually, all issues are tracked publicly on [GitHub](https://github.com/nlohmann/json/issues). If you want to make a private report (e.g., for a vulnerability or to attach an example that is not meant to be published), please send an email to <[email protected]>. | ||
|
||
## Prerequisites | ||
|
||
Please [create an issue](https://github.com/nlohmann/json/issues/new/choose), assuming one does not already exist, and describe your concern. Note you need a [GitHub account](https://github.com/signup/free) for this. | ||
|
||
## Describe your issue | ||
|
||
Clearly describe the issue: | ||
|
||
- If it is a bug, please describe how to **reproduce** it. If possible, attach a complete example which demonstrates the error. Please also state what you **expected** to happen instead of the error. | ||
- If you propose a change or addition, try to give an **example** how the improved code could look like or how to use it. | ||
- If you found a compilation error, please tell us which **compiler** (version and operating system) you used and paste the (relevant part of) the error messages to the ticket. | ||
|
||
Please stick to the provided issue template ([bug report](https://github.com/nlohmann/json/blob/develop/.github/ISSUE_TEMPLATE/bug.yml) if possible. For questions, feature or support requests, please [open a discussion](https://github.com/nlohmann/json/discussions/new). | ||
|
||
## Files to change | ||
|
||
:exclamation: Before you make any changes, note the single-header files [`single_include/nlohmann/json.hpp`](https://github.com/nlohmann/json/blob/develop/single_include/nlohmann/json.hpp) and [`single_include/nlohmann/json_fwd.hpp`](https://github.com/nlohmann/json/blob/develop/single_include/nlohmann/json_fwd.hpp) are **generated** from the source files in the [`include/nlohmann` directory](https://github.com/nlohmann/json/tree/develop/include/nlohmann). Please **do not** edit the files `single_include/nlohmann/json.hpp` and `single_include/nlohmann/json_fwd.hpp` directly, but change the `include/nlohmann` sources and regenerate the files by executing `make amalgamate`. | ||
|
||
To make changes, you need to edit the following files: | ||
|
||
1. [`include/nlohmann/*`](https://github.com/nlohmann/json/tree/develop/include/nlohmann) - These files are the sources of the library. Before testing or creating a pull request, execute `make amalgamate` to regenerate `single_include/nlohmann/json.hpp` and `single_include/nlohmann/json_fwd.hpp`. | ||
|
||
2. [`tests/src/unit-*.cpp`](https://github.com/nlohmann/json/tree/develop/tests/src) - These files contain the [doctest](https://github.com/onqtam/doctest) unit tests which currently cover [100 %](https://coveralls.io/github/nlohmann/json) of the library's code. | ||
|
||
If you add or change a feature, please also add a unit test to this file. The unit tests can be compiled and executed with | ||
|
||
```sh | ||
$ mkdir build | ||
$ cd build | ||
$ cmake .. | ||
$ cmake --build . | ||
$ ctest | ||
``` | ||
|
||
The test cases are also executed with several different compilers on [Travis](https://travis-ci.org/nlohmann/json) once you open a pull request. | ||
|
||
|
||
## Note | ||
|
||
- If you open a pull request, the code will be automatically tested with [Valgrind](http://valgrind.org)'s Memcheck tool to detect memory leaks. Please be aware that the execution with Valgrind _may_ in rare cases yield different behavior than running the code directly. This can result in failing unit tests which run successfully without Valgrind. | ||
- There is a Makefile target `make pretty` which runs [Artistic Style](http://astyle.sourceforge.net) to fix indentation. If possible, run it before opening the pull request. Otherwise, we shall run it afterward. | ||
## Please don't | ||
|
||
- The C++11 support varies between different **compilers** and versions. Please note the [list of supported compilers](https://github.com/nlohmann/json/blob/master/README.md#supported-compilers). Some compilers like GCC 4.7 (and earlier), Clang 3.3 (and earlier), or Microsoft Visual Studio 13.0 and earlier are known not to work due to missing or incomplete C++11 support. Please refrain from proposing changes that work around these compiler's limitations with `#ifdef`s or other means. | ||
- Specifically, I am aware of compilation problems with **Microsoft Visual Studio** (there even is an [issue label](https://github.com/nlohmann/json/issues?utf8=✓&q=label%3A%22visual+studio%22+) for these kind of bugs). I understand that even in 2016, complete C++11 support isn't there yet. But please also understand that I do not want to drop features or uglify the code just to make Microsoft's sub-standard compiler happy. The past has shown that there are ways to express the functionality such that the code compiles with the most recent MSVC - unfortunately, this is not the main objective of the project. | ||
- Please refrain from proposing changes that would **break [JSON](https://json.org) conformance**. If you propose a conformant extension of JSON to be supported by the library, please motivate this extension. | ||
- We shall not extend the library to **support comments**. There is quite some [controversy](https://www.reddit.com/r/programming/comments/4v6chu/why_json_doesnt_support_comments_douglas_crockford/) around this topic, and there were quite some [issues](https://github.com/nlohmann/json/issues/376) on this. We believe that JSON is fine without comments. | ||
- We do not preserve the **insertion order of object elements**. The [JSON standard](https://tools.ietf.org/html/rfc8259.html) defines objects as "an unordered collection of zero or more name/value pairs". To this end, this library does not preserve insertion order of name/value pairs. (In fact, keys will be traversed in alphabetical order as `std::map` with `std::less` is used by default.) Note this behavior conforms to the standard, and we shall not change it to any other order. If you do want to preserve the insertion order, you can specialize the object type with containers like [`tsl::ordered_map`](https://github.com/Tessil/ordered-map) or [`nlohmann::fifo_map`](https://github.com/nlohmann/fifo_map). | ||
- Please do not open pull requests that address **multiple issues**. | ||
## Wanted | ||
The following areas really need contribution: | ||
- Extending the **continuous integration** toward more exotic compilers such as Android NDK, Intel's Compiler, or the bleeding-edge versions Clang. | ||
- Improving the efficiency of the **JSON parser**. The current parser is implemented as a naive recursive descent parser with hand coded string handling. More sophisticated approaches like LALR parsers would be really appreciated. That said, parser generators like Bison or ANTLR do not play nice with single-header files -- I really would like to keep the parser inside the `json.hpp` header, and I am not aware of approaches similar to [`re2c`](http://re2c.org) for parsing. | ||
- Extending and updating existing **benchmarks** to include (the most recent version of) this library. Though efficiency is not everything, speed and memory consumption are very important characteristics for C++ developers, so having proper comparisons would be interesting. |
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 @@ | ||
github: nlohmann | ||
custom: http://paypal.me/nlohmann |
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,93 @@ | ||
name: Bug Report | ||
description: Create a bug report | ||
labels: | ||
- 'kind: bug' | ||
body: | ||
- type: markdown | ||
attributes: | ||
value: > | ||
Thanks for taking the time to fill out this bug report! | ||
Make sure you give it a short and specific **title** so that the report | ||
is searchable and uniquely identifiable. | ||
Note that this form is for bug reports only. Please | ||
[open a discussion](https://github.com/nlohmann/json/discussions/new) | ||
for questions, feature requests, or support requests | ||
- type: textarea | ||
id: summary | ||
attributes: | ||
label: Description | ||
description: > | ||
Please provide an abstract description of the issue to the developers, | ||
and why you consider it to be a bug. Please include any specific links | ||
to the documentation, JSON specification, or code. | ||
validations: | ||
required: true | ||
- type: textarea | ||
id: reproduce | ||
attributes: | ||
label: Reproduction steps | ||
description: > | ||
How do you trigger the bug? Please walk us through step by step. Be as | ||
specific as possible. | ||
validations: | ||
required: true | ||
- type: textarea | ||
id: results | ||
attributes: | ||
label: Expected vs. actual results | ||
description: > | ||
Please describe what you expected to happen after the steps above and | ||
what actually happened. | ||
validations: | ||
required: true | ||
- type: textarea | ||
id: code | ||
attributes: | ||
label: Minimal code example | ||
description: > | ||
If possible, provide a small and self-contained example that triggers | ||
the bug. Please understand that we cannot analyze and debug large code | ||
bases. Please do not paste screenshots here. | ||
render: Shell | ||
- type: textarea | ||
id: output | ||
attributes: | ||
label: Error messages | ||
description: > | ||
Please provide any kind of error output (compilation errors, exception | ||
messages, stack traces, etc.) which can help to diagnose the error. | ||
render: Shell | ||
- type: input | ||
id: compiler | ||
attributes: | ||
label: Compiler and operating system | ||
description: > | ||
On which operating systems and compilers have you observed the issue? | ||
Include as many relevant details about the environment you experienced | ||
the bug in. Make sure you use a | ||
[supported compiler](https://github.com/nlohmann/json#supported-compilers). | ||
validations: | ||
required: true | ||
- type: input | ||
id: version | ||
attributes: | ||
label: Library version | ||
description: > | ||
Which version of the library did you use? If it is a released version, | ||
please enter the version number (e.g., 3.11.2). Otherwise, please enter | ||
the commit hash. If you got the library from another source as the | ||
GitHub repository (e.g., via a package manager), please also state | ||
this. | ||
validations: | ||
required: true | ||
- type: checkboxes | ||
id: validation | ||
attributes: | ||
label: Validation | ||
description: > | ||
Please check these additional steps: | ||
options: | ||
- label: The bug also occurs if the latest version from the [`develop`](https://github.com/nlohmann/json/tree/develop) branch is used. | ||
- label: I can successfully [compile and run the unit tests](https://github.com/nlohmann/json#execute-unit-tests). |
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,5 @@ | ||
blank_issues_enabled: false | ||
contact_links: | ||
- name: Ask a question | ||
url: https://github.com/nlohmann/json/discussions | ||
about: Ask questions and discuss with other community members |
Oops, something went wrong.