Skip to content

Commit

Permalink
Merge branch 'develop' into bson-element-11-uint64
Browse files Browse the repository at this point in the history
# Conflicts:
#	docs/mkdocs/docs/features/binary_formats/bson.md
#	docs/mkdocs/docs/home/exceptions.md
#	include/nlohmann/detail/output/binary_writer.hpp
#	single_include/nlohmann/json.hpp
#	tests/src/unit-bson.cpp
  • Loading branch information
slowriot committed Jan 10, 2025
2 parents 5345c07 + 2d42229 commit d864d43
Show file tree
Hide file tree
Showing 268 changed files with 9,799 additions and 3,798 deletions.
84 changes: 0 additions & 84 deletions .clang-format

This file was deleted.

10 changes: 10 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,9 @@ Checks: '*,
-modernize-concat-nested-namespaces,
-modernize-type-traits,
-modernize-use-constraints,
-modernize-use-designated-initializers,
-modernize-use-nodiscard,
-modernize-use-ranges,
-modernize-use-std-numbers,
-modernize-use-trailing-return-type,
-performance-enum-size,
Expand Down
2 changes: 1 addition & 1 deletion .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Clearly describe the issue:
- 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).
Please stick to the provided issue template ([bug report](https://github.com/nlohmann/json/blob/develop/.github/ISSUE_TEMPLATE/bug.yaml) if possible. For questions, feature or support requests, please [open a discussion](https://github.com/nlohmann/json/discussions/new).

## Files to change

Expand Down
26 changes: 26 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
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/astyle
schedule:
interval: daily

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

- package-ecosystem: pip
directory: /cmake/requirements
schedule:
interval: daily
32 changes: 19 additions & 13 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@6f51ac03b9356f520e9adb1b1b7802705f340c2b # v4.5.0
with:
name: pr
path: pr/
Expand All @@ -25,29 +31,29 @@ jobs:
MAIN_DIR: ${{ github.workspace }}/main
INCLUDE_DIR: ${{ github.workspace }}/main/single_include/nlohmann
TOOL_DIR: ${{ github.workspace }}/tools/tools/amalgamate
ASTYLE_FLAGS: >
--style=allman --indent=spaces=4 --indent-modifiers --indent-switches --indent-preproc-block
--indent-preproc-define --indent-col1-comments --pad-oper --pad-header --align-pointer=type
--align-reference=type --add-brackets --convert-tabs --close-templates --lineend=linux --preserve-date
--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

- name: Install astyle
run: |
sudo apt-get update
sudo apt-get install astyle
python3 -mvenv venv
venv/bin/pip3 install -r $MAIN_DIR/tools/astyle/requirements.txt
- name: Check amalgamation
run: |
Expand All @@ -60,11 +66,11 @@ jobs:
python3 $TOOL_DIR/amalgamate.py -c $TOOL_DIR/config_json.json -s .
python3 $TOOL_DIR/amalgamate.py -c $TOOL_DIR/config_json_fwd.json -s .
echo "Format (1)"
astyle $ASTYLE_FLAGS --suffix=none --quiet $INCLUDE_DIR/json.hpp $INCLUDE_DIR/json_fwd.hpp
${{ github.workspace }}/venv/bin/astyle --project=tools/astyle/.astylerc --suffix=none --quiet $INCLUDE_DIR/json.hpp $INCLUDE_DIR/json_fwd.hpp
diff $INCLUDE_DIR/json.hpp~ $INCLUDE_DIR/json.hpp
diff $INCLUDE_DIR/json_fwd.hpp~ $INCLUDE_DIR/json_fwd.hpp
astyle $ASTYLE_FLAGS $(find docs/examples include tests -type f \( -name '*.hpp' -o -name '*.cpp' -o -name '*.cu' \) -not -path 'tests/thirdparty/*' -not -path 'tests/abi/include/nlohmann/*' | sort)
${{ github.workspace }}/venv/bin/astyle --project=tools/astyle/.astylerc --suffix=orig $(find docs/examples include tests -type f \( -name '*.hpp' -o -name '*.cpp' -o -name '*.cu' \) -not -path 'tests/thirdparty/*' -not -path 'tests/abi/include/nlohmann/*' | sort)
echo Check
find $MAIN_DIR -name '*.orig' -exec false {} \+
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@6f51ac03b9356f520e9adb1b1b7802705f340c2b # v4.5.0
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 }}"
Loading

0 comments on commit d864d43

Please sign in to comment.