Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
81 commits
Select commit Hold shift + click to select a range
02f5bca
Add implementation to retrieve start and end positions of json during…
sushshring Oct 28, 2024
311861f
Add more unit tests and add start/stop parsing for arrays
sushshring Nov 5, 2024
226d79b
Merge branch 'nlohmann:develop' into develop
sushshring Nov 6, 2024
b3f6499
Add raw value for all types
sushshring Nov 8, 2024
ab744aa
Merge branch 'develop' of https://github.com/sushshring/json into dev…
sushshring Nov 8, 2024
d321cdb
Add more tests and fix compiler warning
sushshring Nov 8, 2024
64ad6ce
Amalgamate
Nov 13, 2024
1825117
Another desperate try to fix the CI (#4489)
nlohmann Nov 13, 2024
e820747
Fix CLang GCC warnings
Nov 13, 2024
3629ceb
Fix error in build
Nov 13, 2024
b42036b
Style using astyle 3.1
Nov 13, 2024
fde9a86
Make iterator_proxy_value a forward_iterator (#4371) (#4372)
captaincrutches Nov 15, 2024
fd20975
Add CPack support (#4459)
zjyhjqs Nov 16, 2024
0604140
feat: Rebase `feature/optional` to `develop` (#4036)
fsandhei Nov 16, 2024
e509007
Remove alwayslink=True Bazel flag (#4396)
mering Nov 16, 2024
e3ac5a6
Add test for libstdc++ (#4495)
nlohmann Nov 17, 2024
1c5923e
Add comment for #4494 (#4496)
nlohmann Nov 17, 2024
64f68dc
Suppress warnings in NLOHMANN_JSON_SERIALIZE_ENUM (#4497)
nlohmann Nov 17, 2024
2575678
Fix whitespace changes
Nov 18, 2024
9de6ed1
revert
Nov 18, 2024
3bbca5e
more whitespace reverts
Nov 18, 2024
fa32e81
Address PR comments
Nov 19, 2024
1f218e1
Possible fix for #4485 (#4487)
jordan-hoang Nov 19, 2024
b806d44
Fix failing issues
Nov 19, 2024
7d662ec
More whitespace reverts
Nov 19, 2024
378e091
Fix weak-vtables warning (#4500)
nlohmann Nov 20, 2024
f9f8c07
fix: integer parsed as float when EINTR set in errno (#4506)
StuartGorman Nov 21, 2024
a97041a
Skip enum tests when JSON_DisableEnumSerialization=ON (#4504)
nlohmann Nov 21, 2024
3625875
Address remaining PR comments
Nov 21, 2024
ee32bfc
Make SAX output locale-independent (#4505)
nlohmann Nov 24, 2024
9359441
Address comments
Nov 25, 2024
79e6513
Merge remote-tracking branch 'nlohmann/develop' into develop
Nov 25, 2024
3d6c664
Allow comparing default initialized iterators (#4512)
nlohmann Nov 26, 2024
d333f08
CMake: generate a pkg-config file that follow pkg-config conventions …
dcbaker Nov 26, 2024
a31d8b8
Switch to using custom base class instead of default basic_json
Nov 27, 2024
e41905f
:money_with_wings: thanks @phrrngtn
nlohmann Nov 27, 2024
935c6ee
Optimize binary `get_number` implementation by reading multiple bytes…
TianyiChen Nov 29, 2024
1b9a9d1
Update licenses (#4521)
nlohmann Nov 29, 2024
a006a7a
Add more GCC warning flags (#4524)
nlohmann Dec 1, 2024
9f60e85
Fix return value of get_ptr for unsigned integers (#4525)
nlohmann Dec 6, 2024
1d70d2b
Adding a basic using for a json using the new base class. Also addres…
Dec 4, 2024
814f367
Address decltype comments
Dec 6, 2024
549c79b
Overwork documentation (#4516)
nlohmann Dec 9, 2024
dd81f87
:rocket: fix permissions
nlohmann Dec 10, 2024
981a4c3
:memo: trigger documentation build
nlohmann Dec 10, 2024
f385fe2
:money_with_wings: update sponsors
nlohmann Dec 10, 2024
589641b
Add support of multi-dim C-style array member of struct. (#4262)
peng-wang-cn Dec 10, 2024
20ae363
Replace EOF with char_traits (#4532)
nlohmann Dec 10, 2024
e0a17f8
:memo: add more package managers (#4533)
nlohmann Dec 10, 2024
e6cafa5
:memo: fix CPM.cmake example
nlohmann Dec 11, 2024
4986e99
Diagnostic positions macro (#4)
sushshring Dec 12, 2024
b96a5d1
Fix missed include deletion
Dec 12, 2024
620034e
:recycle: allow patch and diff to be used with arbitrary string types…
nlohmann Dec 13, 2024
4406594
Add docs and address other PR comments (#5)
sushshring Dec 13, 2024
6a2ae22
:memo: add OpenSSF Scorecard badge
nlohmann Dec 15, 2024
4003f8d
[StepSecurity] Apply security best practices (#4539)
step-security-bot Dec 15, 2024
7cfbe32
:arrow_up: Bump pyyaml from 6.0 to 6.0.2 in /tools/serve_header (#4541)
dependabot[bot] Dec 15, 2024
58949c0
:arrow_up: Bump actions/github-script from 6.4.0 to 7.0.1 (#4540)
dependabot[bot] Dec 15, 2024
b6b8378
:arrow_up: Bump github/codeql-action from 2.27.9 to 3.27.9 (#4543)
dependabot[bot] Dec 15, 2024
1c8e26d
:arrow_up: Bump lukka/get-cmake from 3.31.0 to 3.31.2 (#4544)
dependabot[bot] Dec 15, 2024
eb142e3
:arrow_up: Bump ossf/scorecard-action from 2.3.3 to 2.4.0 (#4545)
dependabot[bot] Dec 15, 2024
9e23b5d
:arrow_up: Bump watchdog from 2.1.7 to 6.0.0 in /tools/serve_header (…
dependabot[bot] Dec 15, 2024
677e19e
Clean up (#4546)
nlohmann Dec 16, 2024
8e1b800
Move reuse dependency to requirements.txt file (#4547)
nlohmann Dec 16, 2024
8c67186
Address new PR comments and fix CI tests for documentation
Dec 16, 2024
f2a4ac0
Add step to build the documentation (#4549)
nlohmann Dec 17, 2024
f4910b2
Bump mkdocs-material from 9.5.48 to 9.5.49 in /docs/mkdocs (#4548)
dependabot[bot] Dec 17, 2024
861ec9c
Fix token permissions warnings (#4550)
nlohmann Dec 17, 2024
5362012
[StepSecurity] ci: Harden GitHub Actions (#4551)
step-security-bot Dec 17, 2024
30cd44d
Clean up CI (#4553)
nlohmann Dec 17, 2024
6c04575
Update documentation based on feedback (#6)
sushshring Dec 17, 2024
3d425d6
Merge branch 'develop' into develop
sushshring Dec 17, 2024
94505ba
Address std::size_t and other comments
Dec 17, 2024
556ab6b
Fix new CI issues
Dec 17, 2024
7f599cf
Fix lcov
Dec 17, 2024
5592cb3
Improve lcov case with update to handle_diagnostic_positions call for…
Dec 17, 2024
094bd26
Set parents after insert call (#4537)
nlohmann Dec 18, 2024
920e9a7
Fix indentation of LCOV_EXCL_STOP comments
sushshring Dec 18, 2024
6cb099e
Suppress modernize-use-integer-sign-comparison (#4558)
nlohmann Dec 18, 2024
aa14b15
fix amalgamation astyle issue
Dec 18, 2024
c4d1091
Merge remote-tracking branch 'nlohmann/develop' into develop
Dec 18, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions .clang-tidy
Original file line number Diff line number Diff line change
@@ -1,8 +1,16 @@
# TODO: The first three checks are only removed to get the CI going. They have to be addressed at some point.

Checks: '*,

-portability-template-virtual-member-function,
-bugprone-use-after-move,
-hicpp-invalid-access-moved,

-altera-id-dependent-backward-branch,
-altera-struct-pack-align,
-altera-unroll-loops,
-android-cloexec-fopen,
-boost-use-ranges,
-bugprone-easily-swappable-parameters,
-cert-err58-cpp,
-concurrency-mt-unsafe,
Expand Down Expand Up @@ -44,7 +52,10 @@ Checks: '*,
-modernize-concat-nested-namespaces,
-modernize-type-traits,
-modernize-use-constraints,
-modernize-use-designated-initializers,
-modernize-use-integer-sign-comparison,
-modernize-use-nodiscard,
-modernize-use-ranges,
-modernize-use-std-numbers,
-modernize-use-trailing-return-type,
-performance-enum-size,
Expand Down
21 changes: 21 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
version: 2
updates:
- package-ecosystem: github-actions
directory: /
schedule:
interval: daily

- package-ecosystem: pip
directory: /docs/mkdocs
schedule:
interval: daily

- package-ecosystem: pip
directory: /tools/serve_header
schedule:
interval: daily

- package-ecosystem: pip
directory: /cmake/requirements
schedule:
interval: daily
19 changes: 15 additions & 4 deletions .github/workflows/check_amalgamation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,24 @@ name: "Check amalgamation"
on:
pull_request:

permissions: read-all
permissions:
contents: read

jobs:
save:
runs-on: ubuntu-latest
steps:
- name: Harden Runner
uses: step-security/harden-runner@0080882f6c36860b6ba35c610c98ce87d4e2f26f # v2.10.2
with:
egress-policy: audit

- name: Save PR number
run: |
mkdir -p ./pr
echo ${{ github.event.number }} > ./pr/number
echo ${{ github.event.pull_request.user.login }} > ./pr/author
- uses: actions/upload-artifact@v2
- uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3
with:
name: pr
path: pr/
Expand All @@ -32,14 +38,19 @@ jobs:
--formatted

steps:
- name: Harden Runner
uses: step-security/harden-runner@0080882f6c36860b6ba35c610c98ce87d4e2f26f # v2.10.2
with:
egress-policy: audit

- name: Checkout pull request
uses: actions/checkout@v3
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
path: main
ref: ${{ github.event.pull_request.head.sha }}

- name: Checkout tools
uses: actions/checkout@v3
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
path: tools
ref: develop
Expand Down
11 changes: 8 additions & 3 deletions .github/workflows/cifuzz.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,22 +8,27 @@ jobs:
Fuzzing:
runs-on: ubuntu-latest
steps:
- name: Harden Runner
uses: step-security/harden-runner@0080882f6c36860b6ba35c610c98ce87d4e2f26f # v2.10.2
with:
egress-policy: audit

- name: Build Fuzzers
id: build
uses: google/oss-fuzz/infra/cifuzz/actions/build_fuzzers@master
uses: google/oss-fuzz/infra/cifuzz/actions/build_fuzzers@57fe4475324c5506adbfecdcdd2917f65c86ee9e # master
with:
oss-fuzz-project-name: 'json'
dry-run: false
language: c++
- name: Run Fuzzers
uses: google/oss-fuzz/infra/cifuzz/actions/run_fuzzers@master
uses: google/oss-fuzz/infra/cifuzz/actions/run_fuzzers@57fe4475324c5506adbfecdcdd2917f65c86ee9e # master
with:
oss-fuzz-project-name: 'json'
fuzz-seconds: 300
dry-run: false
language: c++
- name: Upload Crash
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3
if: failure() && steps.build.outcome == 'success'
with:
name: artifacts
Expand Down
19 changes: 12 additions & 7 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@ on:
- cron: '0 19 * * 1'
workflow_dispatch:

permissions:
contents: read

concurrency:
group: ${{ github.workflow }}-${{ github.ref || github.run_id }}
cancel-in-progress: true

permissions:
contents: read

jobs:
CodeQL-Build:

Expand All @@ -26,19 +26,24 @@ jobs:
security-events: write

steps:
- name: Harden Runner
uses: step-security/harden-runner@0080882f6c36860b6ba35c610c98ce87d4e2f26f # v2.10.2
with:
egress-policy: audit

- name: Checkout repository
uses: actions/checkout@v3
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
uses: github/codeql-action/init@df409f7d9260372bd5f19e5b04e83cb3c43714ae # v3.27.9
with:
languages: c-cpp

# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@v2
uses: github/codeql-action/autobuild@df409f7d9260372bd5f19e5b04e83cb3c43714ae # v3.27.9

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
uses: github/codeql-action/analyze@df409f7d9260372bd5f19e5b04e83cb3c43714ae # v3.27.9
12 changes: 9 additions & 3 deletions .github/workflows/comment_check_amalgamation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ on:
types:
- completed

permissions: {}
permissions:
contents: read

jobs:
comment:
Expand All @@ -17,8 +18,13 @@ jobs:
issues: read
pull-requests: write
steps:
- name: Harden Runner
uses: step-security/harden-runner@0080882f6c36860b6ba35c610c98ce87d4e2f26f # v2.10.2
with:
egress-policy: audit

- name: 'Download artifact'
uses: actions/github-script@98814c53be79b1d30f795b907e553d8679345975 # v6.4.0
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
with:
script: |
var artifacts = await github.rest.actions.listWorkflowRunArtifacts({
Expand All @@ -40,7 +46,7 @@ jobs:
- run: unzip pr.zip

- name: 'Comment on PR'
uses: actions/github-script@98814c53be79b1d30f795b907e553d8679345975 # v6.4.0
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
Expand Down
27 changes: 27 additions & 0 deletions .github/workflows/dependency-review.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Dependency Review Action
#
# This Action will scan dependency manifest files that change as part of a Pull Request,
# surfacing known-vulnerable versions of the packages declared or updated in the PR.
# Once installed, if the workflow run is marked as required,
# PRs introducing known-vulnerable packages will be blocked from merging.
#
# Source repository: https://github.com/actions/dependency-review-action
name: 'Dependency Review'
on: [pull_request]

permissions:
contents: read

jobs:
dependency-review:
runs-on: ubuntu-latest
steps:
- name: Harden Runner
uses: step-security/harden-runner@0080882f6c36860b6ba35c610c98ce87d4e2f26f # v2.10.2
with:
egress-policy: audit

- name: 'Checkout Repository'
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: 'Dependency Review'
uses: actions/dependency-review-action@3b139cfc5fae8b618d3eae3675e383bb1769c019 # v4.5.0
10 changes: 8 additions & 2 deletions .github/workflows/labeler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ on:
pull_request_target:
types: [opened, synchronize]

permissions: {}
permissions:
contents: read

jobs:
label:
Expand All @@ -15,6 +16,11 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: srvaroa/labeler@master
- name: Harden Runner
uses: step-security/harden-runner@0080882f6c36860b6ba35c610c98ce87d4e2f26f # v2.10.2
with:
egress-policy: audit

- uses: srvaroa/labeler@1b3cdb1af3e59155a08b9b2436d0d54feaff49e2 # master
env:
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
77 changes: 65 additions & 12 deletions .github/workflows/macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,41 +9,94 @@ on:
pull_request:
workflow_dispatch:

permissions:
contents: read

concurrency:
group: ${{ github.workflow }}-${{ github.ref || github.run_id }}
cancel-in-progress: true

permissions:
contents: read

jobs:
xcode_1:
runs-on: macos-11
# macos-11 is deprecated
# macos-11:
# runs-on: macos-11
# strategy:
# matrix:
# xcode: ['11.7', '12.4', '12.5.1', '13.0']
# env:
# DEVELOPER_DIR: /Applications/Xcode_${{ matrix.xcode }}.app/Contents/Developer
#
# steps:
# - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
# - name: Run CMake
# run: cmake -S . -B build -D CMAKE_BUILD_TYPE=Debug -DJSON_BuildTests=On -DJSON_FastTests=ON
# - name: Build
# run: cmake --build build --parallel 10
# - name: Test
# run: cd build ; ctest -j 10 --output-on-failure

# macos-12 is deprecated (https://github.com/actions/runner-images/issues/10721)
# macos-12:
# runs-on: macos-12 # https://github.com/actions/runner-images/blob/main/images/macos/macos-12-Readme.md
# strategy:
# matrix:
# xcode: ['13.1', '13.2.1', '13.3.1', '13.4.1', '14.0', '14.0.1', '14.1']
# env:
# DEVELOPER_DIR: /Applications/Xcode_${{ matrix.xcode }}.app/Contents/Developer
#
# steps:
# - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
# - name: Run CMake
# run: cmake -S . -B build -D CMAKE_BUILD_TYPE=Debug -DJSON_BuildTests=On -DJSON_FastTests=ON
# - name: Build
# run: cmake --build build --parallel 10
# - name: Test
# run: cd build ; ctest -j 10 --output-on-failure

macos-13:
runs-on: macos-13 # https://github.com/actions/runner-images/blob/main/images/macos/macos-13-Readme.md
strategy:
matrix:
xcode: ['14.1', '14.2', '14.3', '14.3.1', '15.0.1', '15.1', '15.2']
env:
DEVELOPER_DIR: /Applications/Xcode_${{ matrix.xcode }}.app/Contents/Developer

steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Run CMake
run: cmake -S . -B build -D CMAKE_BUILD_TYPE=Debug -DJSON_BuildTests=On -DJSON_FastTests=ON
- name: Build
run: cmake --build build --parallel 10
- name: Test
run: cd build ; ctest -j 10 --output-on-failure

macos-14:
runs-on: macos-14 # https://github.com/actions/runner-images/blob/main/images/macos/macos-14-Readme.md
strategy:
matrix:
xcode: ['11.7', '12.4', '12.5.1', '13.0']
xcode: ['15.3', '15.4']
env:
DEVELOPER_DIR: /Applications/Xcode_${{ matrix.xcode }}.app/Contents/Developer

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Run CMake
run: cmake -S . -B build -D CMAKE_BUILD_TYPE=Debug -DJSON_BuildTests=On -DJSON_FastTests=ON
- name: Build
run: cmake --build build --parallel 10
- name: Test
run: cd build ; ctest -j 10 --output-on-failure

xcode_2:
runs-on: macos-12
macos-15:
runs-on: macos-15 # https://github.com/actions/runner-images/blob/main/images/macos/macos-15-Readme.md
strategy:
matrix:
xcode: ['13.1', '13.2.1', '13.3.1', '13.4.1', '14.0', '14.0.1', '14.1']
xcode: ['16.0', '16.1']
env:
DEVELOPER_DIR: /Applications/Xcode_${{ matrix.xcode }}.app/Contents/Developer

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Run CMake
run: cmake -S . -B build -D CMAKE_BUILD_TYPE=Debug -DJSON_BuildTests=On -DJSON_FastTests=ON
- name: Build
Expand All @@ -58,7 +111,7 @@ jobs:
standard: [11, 14, 17, 20, 23]

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Run CMake
run: cmake -S . -B build -D CMAKE_BUILD_TYPE=Debug -DJSON_BuildTests=On -DJSON_TestStandards=${{ matrix.standard }}
- name: Build
Expand Down
Loading