Commit Graph

4644 Commits

Author SHA1 Message Date
Michael Valladolid
4f64d8d0b4 Modernize integer comparison (#4577)
Replace static_cast<size_t>(-1) with std::numeric_limits<std::size_t>::max()
via the detail::unknown_size() function
2025-01-01 17:01:38 +01:00
Nissim Armand Ben Danan
2134cb947a Fix NLOHMANN_DEFINE_TYPE_INTRUSIVE_WITH_DEFAULT with an empty JSON instance (#4508)
* change NLOHMANN_JSON_FROM_WITH_DEFAULT to let NLOHMANN_DEFINE_TYPE_INTRUSIVE_WITH_DEFAULT work with an empty JSON instance

* fix ci_static_analysis_clang (ci_clang_tidy)

* change NLOHMANN_JSON_FROM_WITH_DEFAULT to let NLOHMANN_DEFINE_TYPE_INTRUSIVE_WITH_DEFAULT work with an empty JSON instance
2024-12-31 08:16:43 +01:00
Niels Lohmann
6057b31df7 Overwork astyle call (#4573)
* 🔧 overwork astyle call

* 🔧 overwork astyle call

* 🔧 overwork astyle call

* 🔧 overwork astyle call

* 🔧 overwork astyle call

* 🔧 overwork astyle call

* 🔧 overwork astyle call

* 🔧 overwork astyle call

* 🔧 overwork astyle call

* 🔧 overwork astyle call

* 🔧 overwork astyle call

* Use ubuntu-latest image to run Valgrind (#4575)

* 🔧 use Clang image to run valgrind

* 🔧 use Clang image to run valgrind

* 🔧 use Clang image to run valgrind

* 🔧 use Ubuntu image to run valgrind

* Use Clang image to run iwyu (#4574)

* 🔧 use Clang image to run iwyu

* 🔧 use Clang image to run iwyu

* 🔧 overwork astyle call

* 🔧 overwork astyle call

* 🔧 overwork astyle call

* 🔧 overwork astyle call

* 🔧 overwork astyle call

* 🔧 overwork astyle call

* 🔧 overwork astyle call

* 🔧 overwork astyle call

* 🔧 overwork astyle call

* 🔧 overwork astyle call

* 🔧 overwork astyle call

* 🎨 format code

* 🔨 clean up
2024-12-29 17:06:03 +01:00
Niels Lohmann
0fa326a8e8 Use Clang image to run iwyu (#4574)
* 🔧 use Clang image to run iwyu

* 🔧 use Clang image to run iwyu
2024-12-29 15:49:35 +01:00
Niels Lohmann
8314ac2f76 Use ubuntu-latest image to run Valgrind (#4575)
* 🔧 use Clang image to run valgrind

* 🔧 use Clang image to run valgrind

* 🔧 use Clang image to run valgrind

* 🔧 use Ubuntu image to run valgrind
2024-12-29 15:49:20 +01:00
Harinath Nampally
69c8758d51 fix the abi tests for diagnostics positions feature (#4572) 2024-12-28 16:24:52 +01:00
Harinath Nampally
5ff90d9e02 fix diagnostic positions related compilation errors (#4570) 2024-12-28 16:22:45 +01:00
dependabot[bot]
6be4e85600 Bump cppcheck from 1.4.6 to 1.4.7 in /cmake/requirements (#4567) 2024-12-23 19:17:06 +01:00
Greg Marr
663058e7d1 Fix typo in nlohmann_define_derived_type.md (#4565) 2024-12-21 12:53:15 +01:00
Einars Netlis-Galejs
af4ad7915c Add ONLY_SERIALIZE for NLOHMANN_DEFINE_DERIVED_TYPE_* macros (#4562) 2024-12-20 11:31:22 +01:00
Sushrut Shringarputale
58f5f25968 json start/end position implementation (#4517)
* Add implementation to retrieve start and end positions of json during parse

* Add more unit tests and add start/stop parsing for arrays

* Add raw value for all types

* Add more tests and fix compiler warning

* Amalgamate

* Fix CLang GCC warnings

* Fix error in build

* Style using astyle 3.1

* Fix whitespace changes

* revert

* more whitespace reverts

* Address PR comments

* Fix failing issues

* More whitespace reverts

* Address remaining PR comments

* Address comments

* Switch to using custom base class instead of default basic_json

* Adding a basic using for a json using the new base class. Also address PR comments and fix CI failures

* Address decltype comments

* Diagnostic positions macro (#4)

Co-authored-by: Sush Shringarputale <sushring@linux.microsoft.com>

* Fix missed include deletion

* Add docs and address other PR comments (#5)

* Add docs and address other PR comments

---------

Co-authored-by: Sush Shringarputale <sushring@linux.microsoft.com>

* Address new PR comments and fix CI tests for documentation

* Update documentation based on feedback (#6)

---------

Co-authored-by: Sush Shringarputale <sushring@linux.microsoft.com>

* Address std::size_t and other comments

* Fix new CI issues

* Fix lcov

* Improve lcov case with update to handle_diagnostic_positions call for discarded values

* Fix indentation of LCOV_EXCL_STOP comments

* fix amalgamation astyle issue

---------

Co-authored-by: Sush Shringarputale <sushring@linux.microsoft.com>
2024-12-18 22:46:14 +01:00
dependabot[bot]
733c59588d Bump actions/upload-artifact from 4.4.3 to 4.5.0 (#4557) 2024-12-18 18:43:22 +00:00
Niels Lohmann
6cb099e30e Suppress modernize-use-integer-sign-comparison (#4558) 2024-12-18 17:44:56 +01:00
Niels Lohmann
094bd2651b Set parents after insert call (#4537)
* 🐛 set parents after insert call

* 🚨 fix warning
2024-12-18 09:44:09 +01:00
Niels Lohmann
30cd44df95 Clean up CI (#4553)
* 💚 overwork cppcheck

* 🔒 adjust permissions

* 💚 fixes

* 💚 fixes
2024-12-17 18:58:05 +01:00
StepSecurity Bot
5362012fdd [StepSecurity] ci: Harden GitHub Actions (#4551)
Signed-off-by: StepSecurity Bot <bot@stepsecurity.io>
2024-12-17 15:20:06 +01:00
Niels Lohmann
861ec9c3c6 Fix token permissions warnings (#4550)
* 🚨 fix token permissions warnings

* 🚨 fix token permissions warnings

* 🚨 fix token permissions warnings
2024-12-17 12:55:19 +01:00
dependabot[bot]
f4910b20ce Bump mkdocs-material from 9.5.48 to 9.5.49 in /docs/mkdocs (#4548) 2024-12-17 09:50:23 +00:00
Niels Lohmann
f2a4ac0673 Add step to build the documentation (#4549)
* 💚 add step to build the documentation

* 💚 add step to build the documentation
2024-12-17 09:48:24 +01:00
Niels Lohmann
8e1b800017 Move reuse dependency to requirements.txt file (#4547) 2024-12-16 17:25:18 +01:00
Niels Lohmann
677e19e39c Clean up (#4546) 2024-12-16 07:23:35 +01:00
dependabot[bot]
9e23b5d61e ⬆️ Bump watchdog from 2.1.7 to 6.0.0 in /tools/serve_header (#4542) 2024-12-15 22:39:16 +00:00
dependabot[bot]
eb142e33c0 ⬆️ Bump ossf/scorecard-action from 2.3.3 to 2.4.0 (#4545) 2024-12-15 21:54:00 +00:00
dependabot[bot]
1c8e26dcb4 ⬆️ Bump lukka/get-cmake from 3.31.0 to 3.31.2 (#4544) 2024-12-15 21:23:59 +00:00
dependabot[bot]
b6b8378c8c ⬆️ Bump github/codeql-action from 2.27.9 to 3.27.9 (#4543) 2024-12-15 20:55:09 +00:00
dependabot[bot]
58949c0ad5 ⬆️ Bump actions/github-script from 6.4.0 to 7.0.1 (#4540) 2024-12-15 20:13:29 +00:00
dependabot[bot]
7cfbe321be ⬆️ Bump pyyaml from 6.0 to 6.0.2 in /tools/serve_header (#4541) 2024-12-15 20:12:27 +00:00
StepSecurity Bot
4003f8da02 [StepSecurity] Apply security best practices (#4539)
Signed-off-by: StepSecurity Bot <bot@stepsecurity.io>
2024-12-15 18:31:21 +01:00
Niels Lohmann
6a2ae22a5a 📝 add OpenSSF Scorecard badge 2024-12-15 17:16:26 +01:00
Niels Lohmann
620034ecec ♻️ allow patch and diff to be used with arbitrary string types (#4536) 2024-12-13 07:24:50 +01:00
Niels Lohmann
e6cafa573a 📝 fix CPM.cmake example 2024-12-11 08:31:43 +01:00
Niels Lohmann
e0a17f8475 📝 add more package managers (#4533) 2024-12-10 23:18:39 +01:00
Niels Lohmann
20ae363a71 Replace EOF with char_traits (#4532)
* 📝 update customers

* ♻️ replace EOF with char_traits #2755
2024-12-10 20:51:47 +01:00
peng-wang-cn
589641b175 Add support of multi-dim C-style array member of struct. (#4262)
* Add support of multi-dim C-style array.

* Support up to 4 dimensional array.

* Suppress clang-tidy checks for C-style arrays
2024-12-10 13:18:21 +01:00
Niels Lohmann
f385fe28f2 💸 update sponsors 2024-12-10 11:59:01 +01:00
Niels Lohmann
981a4c39f4 📝 trigger documentation build 2024-12-10 09:41:45 +01:00
Niels Lohmann
dd81f878f7 🚀 fix permissions 2024-12-10 09:39:21 +01:00
Niels Lohmann
549c79ba7e Overwork documentation (#4516) 2024-12-09 23:02:30 +01:00
Niels Lohmann
9f60e85557 Fix return value of get_ptr for unsigned integers (#4525)
* 🐛 fix return value of get_ptr for unsigned integers

* 📝 update documentation
2024-12-06 18:38:25 +01:00
Niels Lohmann
a006a7a48b Add more GCC warning flags (#4524)
* 🔧 add more GCC warning flags

* 👷 use GCC image for GCC test

* 👷 use GCC image for GCC test

* 👷 use GCC image for GCC test

* 👷 use GCC image for GCC test

* 👷 use GCC image for GCC test

* 👷 use GCC image for GCC test

* 👷 use GCC image for GCC test

* 👷 use GCC image for GCC test

* 🔧 adjust flags

* 👷 adjust jobs

* 👷 adjust jobs
2024-12-01 16:13:48 +01:00
Niels Lohmann
1b9a9d1f21 Update licenses (#4521)
* 📄 update licenses

* 📄 update licenses
2024-11-29 17:38:42 +01:00
Tianyi Chen
935c6eeb5a Optimize binary get_number implementation by reading multiple bytes at once (#4391)
* multibyte binary reader

* wide_string_input_adapter fallback to get_character

Update input_adapters.hpp

* Update json.hpp

* Add from msgpack test

* Test for broken msgpack with stream, address some warnings

* Reading binary number from wchar as an error, address warnings

* Not casting float to int, it violates strict aliasing rule
2024-11-29 09:19:58 +01:00
Niels Lohmann
e41905fcb0 💸 thanks @phrrngtn 2024-11-27 18:03:21 +01:00
Dylan Baker
d333f08958 CMake: generate a pkg-config file that follow pkg-config conventions (#4456)
* CMake: configure pkg-config with @only

And use @ replacement instead of {}, since ${} is significant in
pkg-config's format

* CMake: use conventional prefix and incluedir variables in pkg-config

This is more standard, and has some advantages when cross compiling.
This also means that the pkg-config files generated by Meson and CMake
now match.
2024-11-26 08:39:11 +01:00
Niels Lohmann
3d6c664de2 Allow comparing default initialized iterators (#4512) 2024-11-26 06:35:14 +01:00
Niels Lohmann
ee32bfc1c2 Make SAX output locale-independent (#4505)
* 🐛 make SAX output locale-independent #4084

*  add test

*  add test

*  add test

*  add test

*  add test

*  add test

* 🐛 make SAX output locale-independent #4084

* 🐛 make SAX output locale-independent #4084

* 🐛 make SAX output locale-independent #4084

* 🐛 make SAX output locale-independent #4084

* 🐛 make SAX output locale-independent #4084

* 🐛 make SAX output locale-independent #4084

* 🐛 make SAX output locale-independent #4084

* 🐛 make SAX output locale-independent #4084

* 🐛 make SAX output locale-independent #4084

* 🐛 make SAX output locale-independent #4084

* 🐛 make SAX output locale-independent #4084

* 🐛 make SAX output locale-independent #4084
2024-11-24 21:14:00 +01:00
Niels Lohmann
a97041a98f Skip enum tests when JSON_DisableEnumSerialization=ON (#4504)
*  skip enum tests when JSON_DisableEnumSerialization=ON

*  skip enum tests when JSON_DisableEnumSerialization=ON
2024-11-21 17:19:16 +01:00
Stuart Gorman
f9f8c07792 fix: integer parsed as float when EINTR set in errno (#4506)
* fix: integer parsed as float when EINTR set in errno

* chore: make amalgamate

* chore: make pretty

---------

Co-authored-by: Stuart Gorman <Stuart.Gorman@kallipr.com>
2024-11-21 13:09:29 +01:00
Niels Lohmann
378e091795 Fix weak-vtables warning (#4500)
* 🔧 remove warning suppression

* 🚨 fix weak-vtables warning #4087

* 🚨 suppress -Wweak-vtables warning

* 🚨 suppress -Wweak-vtables warning

*  fix test

*  fix test

*  fix test
2024-11-20 08:29:44 +01:00
jh96
1f218e1074 Possible fix for #4485 (#4487)
* Possible fix for #4485

Throw's an exception when i is nullptr,
also added a testcase for this scenario though most likely in the wrong test file.cpp

* quick cleanup

* Fix compile issues

* moved tests around, changed exceptions, removed a possibly unneeded include

* add back include <memory> for testing something

* Ninja doesn't like not having a \n, at end of file, adding it back

* update input_adapter file to deal with empty/null file ptr.

* ran make pretty

* added test for inputadapter

* ran make amalgamate

* Update tests/src/unit-deserialization.cpp

Co-authored-by: Niels Lohmann <niels.lohmann@gmail.com>

* Update tests/src/unit-deserialization.cpp

Co-authored-by: Niels Lohmann <niels.lohmann@gmail.com>

* Update input adapters.hpp with new includes

* fix unabigious use of _, (there was a double declare)

* did the amalagamate

* rm duplicate includes

* make amalgamate again

* reorder

* amalgamate

* moved it above

* amalgamate

---------

Co-authored-by: Jordan <jordan-hoang@users.noreply.github.com>
Co-authored-by: Niels Lohmann <niels.lohmann@gmail.com>
2024-11-19 13:54:04 +01:00