Skip to content

Commit 2768931

Browse files
authored
[v3.0.0] djson v3.0 (#9)
* Initial v3.0 * CI fixes * Doxygen, README * Doc strings * Ignore Doxyfile (generated) * README: link to API reference.
1 parent f71baea commit 2768931

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

53 files changed

+5487
-1938
lines changed

.clang-format

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,13 @@
11
---
22
Language: Cpp
3-
BasedOnStyle: LLVM
3+
BasedOnStyle: LLVM
44
AlwaysBreakTemplateDeclarations: Yes
55
BreakBeforeBraces: Attach
66
ColumnLimit: 160
77
SpaceAfterTemplateKeyword: true
88
Standard: c++20
99
TabWidth: 4
1010
IndentWidth: 4
11-
IndentRequires: true
1211
UseTab: Always
1312
AllowShortEnumsOnASingleLine: true
1413
AllowShortCaseLabelsOnASingleLine: true
@@ -17,15 +16,16 @@ AllowShortLambdasOnASingleLine: All
1716
AllowShortBlocksOnASingleLine: Always
1817
AllowShortIfStatementsOnASingleLine: Always
1918
AllowShortLoopsOnASingleLine: true
19+
IndentRequires: true
2020
IncludeCategories:
21-
# Headers in <> with .hpp extension.
22-
- Regex: '<([A-Za-z0-9\/-_])+\.hpp>'
23-
Priority: 1
24-
# Headers in <> with .h extension.
25-
- Regex: '<([A-Za-z0-9\/-_])+\.h>'
26-
Priority: 10
27-
# Headers in <> without extension.
28-
- Regex: '<([A-Za-z0-9\/-_])+>'
29-
Priority: 20
21+
# Headers in <> with .h extension.
22+
- Regex: '<([A-Za-z0-9\/-_])+\.h>'
23+
Priority: 10
24+
# Headers in <> with .hpp extension.
25+
- Regex: '<([A-Za-z0-9\/-_])+\.hpp>'
26+
Priority: 20
27+
# Headers in <> without extension.
28+
- Regex: '<([A-Za-z0-9\/-_])+>'
29+
Priority: 30
3030
PointerAlignment: Left
31-
...
31+
QualifierAlignment: Right

.clang-tidy

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
---
2+
Checks: 'clang-analyzer-*,
3+
concurrency-*,
4+
cppcoreguidelines-*,
5+
-cppcoreguidelines-non-private-member-variables-in-classes,
6+
-cppcoreguidelines-avoid-magic-numbers,
7+
-cppcoreguidelines-avoid-const-or-ref-data-members,
8+
-cppcoreguidelines-avoid-do-while,
9+
misc-*,
10+
-misc-non-private-member-variables-in-classes,
11+
-misc-no-recursion,
12+
modernize-*,
13+
performance-*,
14+
portability-*,
15+
readability-*,
16+
-readability-identifier-length,
17+
-readability-implicit-bool-conversion,
18+
-readability-magic-numbers,
19+
-readability-redundant-member-init,
20+
-readability-uppercase-literal-suffix'
21+
...

.editorconfig

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,14 @@ indent_style = tab
66
# Optional: git will commit as lf, this will only affect local files
77
end_of_line = lf
88

9-
[*.{py,md,yml,sh,cmake,txt,json}]
9+
[*.{py,md,yml,sh,cmake,json}]
1010
indent_style = space
1111
indent_size = 2
1212

13-
[*.{py,md,yml,sh,cmake,txt,json}.in]
13+
[*.{py,md,yml,sh,cmake,json}.in]
14+
indent_style = space
15+
indent_size = 2
16+
17+
[CMakeLists.txt]
1418
indent_style = space
1519
indent_size = 2

.github/format_check_diff.sh

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
#!/bin/bash
2+
3+
[[ ! $(git --version) ]] && exit 1
4+
5+
output=$(git diff)
6+
7+
if [[ "$output" != "" ]]; then
8+
echo -e "One or more source files are not formatted!\n\n$output\n"
9+
echo -e "Using $(clang-format --version)\n"
10+
exit 1
11+
fi
12+
13+
echo "All source files are formatted"
14+
exit

.github/workflows/ci.yml

Lines changed: 105 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,113 @@
1-
name: ci
2-
on:
3-
push:
4-
tags-ignore: v*.*
5-
branches:
6-
- '*'
1+
name: ci-pr
2+
on: [pull_request, workflow_dispatch]
73
jobs:
8-
build-linux:
4+
format-check:
95
runs-on: ubuntu-latest
106
steps:
11-
- uses: actions/checkout@v2
7+
- uses: actions/checkout@v4
8+
- name: format code
9+
run: scripts/format_code.sh
10+
- name: check diff
11+
run: .github/format_check_diff.sh
12+
x64-linux-gcc:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- uses: actions/checkout@v4
1216
- name: init
13-
run: sudo apt install -yqq ninja-build g++-11
14-
- name: configure gcc
15-
run: cmake -S . --preset=default -B build -DCMAKE_CXX_COMPILER=g++-11
16-
- name: configure clang
17-
run: cmake -S . --preset=ninja-clang -B clang
18-
- name: build gcc
19-
run: cmake --build build --config=Release
20-
- name: build clang
21-
run: cmake --build clang --config=Release
22-
- name: test
23-
run: cd build && ctest -C Release
24-
build-windows:
17+
run: uname -m; sudo apt install -yqq ninja-build
18+
- name: configure
19+
run: cmake -S . --preset=ninja-gcc -B build -DCMAKE_C_COMPILER=gcc-14 -DCMAKE_CXX_COMPILER=g++-14
20+
- name: build debug
21+
run: cmake --build build --config=Debug -- -v
22+
- name: build release
23+
run: cmake --build build --config=Release -- -v
24+
- name: test debug
25+
run: cd build && ctest -V -C Debug
26+
- name: test release
27+
run: cd build && ctest -V -C Release
28+
x64-linux-clang:
29+
runs-on: ubuntu-latest
30+
steps:
31+
- uses: actions/checkout@v4
32+
- name: init
33+
run: |
34+
uname -m
35+
sudo apt update -yqq && sudo apt install -yqq clang-19 ninja-build
36+
sudo update-alternatives --remove-all clang++
37+
sudo update-alternatives --install /usr/bin/clang++ clang++ /usr/bin/clang++-19 10
38+
- name: configure
39+
run: cmake -S . --preset=ninja-clang -B build
40+
- name: build debug
41+
run: cmake --build build --config=Debug -- -v
42+
- name: build release
43+
run: cmake --build build --config=Release -- -v
44+
- name: test debug
45+
run: cd build && ctest -V -C Debug
46+
- name: test release
47+
run: cd build && ctest -V -C Release
48+
arm64-linux-gcc:
49+
runs-on: ubuntu-24.04-arm
50+
steps:
51+
- uses: actions/checkout@v4
52+
- name: init
53+
run: uname -m
54+
- name: configure
55+
run: cmake -S . --preset=ninja-gcc -B build -DCMAKE_C_COMPILER=gcc-14 -DCMAKE_CXX_COMPILER=g++-14
56+
- name: build debug
57+
run: cmake --build build --config=Debug -- -v
58+
- name: build release
59+
run: cmake --build build --config=Release -- -v
60+
- name: test debug
61+
run: cd build && ctest -V -C Debug
62+
- name: test release
63+
run: cd build && ctest -V -C Release
64+
arm64-linux-clang:
65+
runs-on: ubuntu-24.04-arm
66+
steps:
67+
- uses: actions/checkout@v4
68+
- name: init
69+
run: |
70+
uname -m
71+
sudo apt update -yqq && sudo apt install -yqq clang-19 ninja-build
72+
sudo update-alternatives --remove-all clang++
73+
sudo update-alternatives --install /usr/bin/clang++ clang++ /usr/bin/clang++-19 10
74+
- name: configure
75+
run: cmake -S . --preset=ninja-clang -B build
76+
- name: build debug
77+
run: cmake --build build --config=Debug -- -v
78+
- name: build release
79+
run: cmake --build build --config=Release -- -v
80+
- name: test debug
81+
run: cd build && ctest -V -C Debug
82+
- name: test release
83+
run: cd build && ctest -V -C Release
84+
x64-windows-vs22:
2585
runs-on: windows-latest
2686
steps:
27-
- uses: actions/checkout@v2
87+
- uses: actions/checkout@v4
2888
- name: configure
2989
run: cmake -S . --preset=vs22 -B build
30-
- name: build
31-
run: cmake --build build --config=Release
32-
- name: test
33-
run: cd build && ctest -C Release
90+
- name: build debug
91+
run: cmake --build build --config=Debug --parallel
92+
- name: build release
93+
run: cmake --build build --config=Release --parallel
94+
- name: test debug
95+
run: cd build && ctest -V -C Debug
96+
- name: test release
97+
run: cd build && ctest -V -C Release
98+
x64-windows-clang:
99+
runs-on: windows-latest
100+
steps:
101+
- uses: actions/checkout@v4
102+
- name: init
103+
run: choco install ninja
104+
- name: configure
105+
run: cmake -S . --preset=ninja-clang -B clang
106+
- name: build debug
107+
run: cmake --build clang --config=Debug -- -v
108+
- name: build release
109+
run: cmake --build clang --config=Release -- -v
110+
- name: test debug
111+
run: cd clang && ctest -V -C Debug
112+
- name: test release
113+
run: cd clang && ctest -V -C Release

.github/workflows/deploy_docs.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: deploy-docs
2+
on:
3+
push:
4+
tags:
5+
- 'v*'
6+
jobs:
7+
deploy:
8+
runs-on: ubuntu-latest
9+
permissions:
10+
contents: write # To push a branch
11+
pages: write # To push to a GitHub Pages site
12+
id-token: write # To update the deployment status
13+
steps:
14+
- uses: actions/checkout@v4
15+
with:
16+
fetch-depth: 0
17+
- name: init
18+
run: sudo apt update -yqq && sudo apt install doxygen
19+
- name: build docs
20+
run: cmake -P scripts/build_docs.cmake
21+
- name: setup pages
22+
uses: actions/configure-pages@v4
23+
- name: upload artifact
24+
uses: actions/upload-pages-artifact@v3
25+
with:
26+
path: 'docs/html'
27+
- name: Deploy to GitHub Pages
28+
id: deployment
29+
uses: actions/deploy-pages@v4

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,6 @@ CMakeSettings.json
1010
compile_commands.json
1111
/CMakeUserPresets.json
1212

13-
wiki
13+
wiki/
14+
docs/
15+
Doxyfile

0 commit comments

Comments
 (0)