From 90c330ef1e5139f4e296a52dc6168fa297ecc0bf Mon Sep 17 00:00:00 2001 From: Michel Estermann Date: Wed, 11 Mar 2026 00:31:48 +0100 Subject: [PATCH 1/5] clean-up dockerfile --- .devcontainer/Dockerfile | 9 --------- 1 file changed, 9 deletions(-) diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index 0a09ad4..8c8a1bd 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -12,20 +12,11 @@ RUN apt-get update \ && apt-get -qq install -y --no-install-recommends \ make \ build-essential \ - ninja-build \ cmake \ - ccache \ - clang-18 \ - clang-tidy-18 \ - clang-format-18 \ - clangd-18 \ dpkg \ pkg-config \ - doxygen \ - lcov \ git \ python3-full \ - gcc-14 \ file \ ssh-client \ && apt-get clean \ From 0a9b081015d063ae8cc04f47ef7d02359dab5f98 Mon Sep 17 00:00:00 2001 From: Michel Estermann Date: Thu, 12 Mar 2026 00:16:13 +0100 Subject: [PATCH 2/5] Added more pre-commit hooks --- .clang-format | 1 - .cmake-format.yaml | 82 -- .devcontainer/devcontainer.json | 110 +-- ...x-sanatizer.yml => ci-linux-sanitizer.yml} | 2 +- .markdownlint.yaml | 9 + .pre-commit-config.yaml | 53 +- .vscode/c_cpp_properties.json | 32 +- .vscode/extensions.json | 30 +- .vscode/launch.json | 70 +- .vscode/settings.json | 30 +- .vscode/tasks.json | 244 ++--- CMakePresets.json | 892 +++++++++--------- README.md | 228 +++-- apps/cli/src/argument_parser.cpp | 2 +- apps/cli/tests/argument_parser_test.cpp | 44 +- apps/qt/CMakeLists.txt | 2 +- apps/qt/cmake/Qt.cmake | 1 - apps/qt/country_data_model.cpp | 4 +- apps/qt/main.cpp | 4 +- apps/qt/mainwindow.cpp | 2 +- build.sh | 21 +- cmake/CPackConfig.cmake | 6 +- cmake/Doxygen.cmake | 2 +- docs/CMakeLists.txt | 2 +- format_source_files.sh | 6 +- include/coronan/corona-api_datatypes.h | 2 +- include/coronan/ssl_client.h | 4 +- tests/corona-api_json_parser_test.cpp | 2 +- typos.toml | 7 + 29 files changed, 937 insertions(+), 957 deletions(-) rename .github/workflows/{ci-linux-sanatizer.yml => ci-linux-sanitizer.yml} (99%) create mode 100644 .markdownlint.yaml create mode 100644 typos.toml diff --git a/.clang-format b/.clang-format index e27e485..c3c6278 100644 --- a/.clang-format +++ b/.clang-format @@ -1,5 +1,4 @@ --- -Language: Cpp # BasedOnStyle: LLVM AccessModifierOffset: -2 AlignAfterOpenBracket: Align diff --git a/.cmake-format.yaml b/.cmake-format.yaml index 33e4f28..dc81638 100644 --- a/.cmake-format.yaml +++ b/.cmake-format.yaml @@ -1,92 +1,10 @@ --- parse: additional_commands: - _add_layer_library: - pargs: 2+ - kwargs: - FORBIDDEN: '*' - LINK_LIBS: - kwargs: - PUBLIC: '*' - PRIVATE: '*' - INCLUDE_DIRS: - kwargs: - PUBLIC: '*' - PRIVATE: '*' - add_infrastructure_library: - pargs: 2+ - kwargs: - LINK_LIBS: - kwargs: - PUBLIC: '*' - PRIVATE: '*' - INCLUDE_DIRS: - kwargs: - PUBLIC: '*' - PRIVATE: '*' - add_application_library: - pargs: 2+ - kwargs: - LINK_LIBS: - kwargs: - PUBLIC: '*' - PRIVATE: '*' - INCLUDE_DIRS: - kwargs: - PUBLIC: '*' - PRIVATE: '*' - add_domain_library: - pargs: 2+ - kwargs: - LINK_LIBS: - kwargs: - PUBLIC: '*' - PRIVATE: '*' - INCLUDE_DIRS: - kwargs: - PUBLIC: '*' - PRIVATE: '*' - add_libs_library: - pargs: 2+ - kwargs: - LINK_LIBS: - kwargs: - PUBLIC: '*' - PRIVATE: '*' - INCLUDE_DIRS: - kwargs: - PUBLIC: '*' - PRIVATE: '*' - add_utils_library: - pargs: 2+ - kwargs: - LINK_LIBS: - kwargs: - PUBLIC: '*' - PRIVATE: '*' - INCLUDE_DIRS: - kwargs: - PUBLIC: '*' - PRIVATE: '*' - add_mock_library: - pargs: 2+ - kwargs: - MOCKS: '*' - add_interface_library: - pargs: 2 enable_coverage: pargs: 1 enable_doxygen: pargs: 1 - generate_arc42_documentation: - pargs: 1 - add_unit_test: - pargs: 2+ - kwargs: - LINK_LIBS: - kwargs: - PUBLIC: '*' - PRIVATE: '*' enable_sanitizers: pargs: 1 enable_static_analysis: diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 933ac77..46df28b 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -1,56 +1,60 @@ { - "name": "C++ noVNC", - "build": { - "context": "..", - "dockerfile": "Dockerfile", - "args": { - "CLANG_VERSION": "19", - "GCC_VERSION": "14", - "BASE_IMAGE": "mcr.microsoft.com/devcontainers/base:ubuntu" - } - }, - "mounts": [ - "source=${localEnv:HOME}/.ssh,target=/home/vscode/.ssh,type=bind" - ], - "workspaceMount": "source=${localWorkspaceFolder},target=/workspaces/Coronan,type=bind", - "updateRemoteUserUID": true, - "postStartCommand": "git config --global --add safe.directory ${containerWorkspaceFolder}", - "postAttachCommand": "pre-commit install -f --hook-type pre-commit && conan profile detect --force", - "customizations": { - "vscode": { - "extensions": [ - "ms-vscode.cpptools", - "ms-vscode.cpptools-extension-pack", - "ms-vscode.cmake-tools", - "xaver.clang-format", - "ms-python.python", - "ms-python.autopep8", - "jeff-hykin.better-cpp-syntax", - "matepek.vscode-catch2-test-adapter", - "mhutchie.git-graph", - "cs128.cs128-clang-tidy", - "donjayamanne.githistory", - "webfreak.debug", - "jnoortheen.nix-ide", - "hbenl.vscode-test-explorer", - "ms-azuretools.vscode-docker", - "actboy168.tasks", - "streetsidesoftware.code-spell-checker", - "github.vscode-pull-request-github" - ] - } - }, - "features": { - "ghcr.io/devcontainers/features/nix:1": {}, - "ghcr.io/ChristopherMacGown/devcontainer-features/direnv:1": {} - }, - "forwardPorts": [ - 6080 - ], - "portsAttributes": { - "6080": { - "label": "noVNC", - "onAutoForward": "openPreview" - } + "name": "C++ noVNC", + "build": { + "context": "..", + "dockerfile": "Dockerfile", + "args": { + "CLANG_VERSION": "19", + "GCC_VERSION": "14", + "BASE_IMAGE": "mcr.microsoft.com/devcontainers/base:ubuntu" } + }, + "mounts": [ + "source=${localEnv:HOME}/.ssh,target=/home/vscode/.ssh,type=bind" + ], + "workspaceMount": "source=${localWorkspaceFolder},target=/workspaces/Coronan,type=bind", + "updateRemoteUserUID": true, + "postStartCommand": "git config --global --add safe.directory ${containerWorkspaceFolder}", + "postAttachCommand": "pre-commit install -f --hook-type pre-commit && conan profile detect --force", + "containerEnv": { + "DISPLAY": ":0" + }, + "customizations": { + "vscode": { + "extensions": [ + "ms-vscode.cpptools", + "ms-vscode.cpptools-extension-pack", + "ms-vscode.cmake-tools", + "xaver.clang-format", + "ms-python.python", + "ms-python.autopep8", + "jeff-hykin.better-cpp-syntax", + "matepek.vscode-catch2-test-adapter", + "mhutchie.git-graph", + "cs128.cs128-clang-tidy", + "donjayamanne.githistory", + "webfreak.debug", + "jnoortheen.nix-ide", + "hbenl.vscode-test-explorer", + "ms-azuretools.vscode-docker", + "actboy168.tasks", + "streetsidesoftware.code-spell-checker", + "github.vscode-pull-request-github" + ] + } + }, + "features": { + "ghcr.io/devcontainers/features/nix:1": {}, + "ghcr.io/ChristopherMacGown/devcontainer-features/direnv:1": {} + }, + "forwardPorts": [ + 5901, + 6080 + ], + "portsAttributes": { + "6080": { + "label": "noVNC", + "onAutoForward": "openPreview" + } + } } diff --git a/.github/workflows/ci-linux-sanatizer.yml b/.github/workflows/ci-linux-sanitizer.yml similarity index 99% rename from .github/workflows/ci-linux-sanatizer.yml rename to .github/workflows/ci-linux-sanitizer.yml index 2c068ec..8d7bac9 100644 --- a/.github/workflows/ci-linux-sanatizer.yml +++ b/.github/workflows/ci-linux-sanitizer.yml @@ -1,5 +1,5 @@ --- -name: Linux Sanatizer Builds +name: Linux Sanitizer Builds on: push: diff --git a/.markdownlint.yaml b/.markdownlint.yaml new file mode 100644 index 0000000..ee94d42 --- /dev/null +++ b/.markdownlint.yaml @@ -0,0 +1,9 @@ +--- +# Disable first-line-heading +MD041: false +# Disable line checking +MD013: false +# Disable checking for the multiple headings with the same content. +MD024: false +# Allow inline HTML, useful for positioning images. +MD033: false diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 64d532d..a8ccbeb 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -4,31 +4,78 @@ repos: rev: v6.0.0 hooks: - id: check-added-large-files + stages: [pre-commit] - id: check-case-conflict + stages: [pre-commit] - id: check-merge-conflict + stages: [pre-commit] - id: check-symlinks + stages: [pre-commit] - id: check-yaml + stages: [pre-commit] - id: check-json + stages: [pre-commit] - id: check-toml + stages: [pre-commit] - id: check-executables-have-shebangs + stages: [pre-commit] + - id: check-shebang-scripts-are-executable + stages: [pre-commit] - id: end-of-file-fixer + stages: [pre-commit] - id: mixed-line-ending + stages: [pre-commit] - id: trailing-whitespace - - repo: https://github.com/pocc/pre-commit-hooks - rev: v1.3.5 + stages: [pre-commit] + args: [--markdown-linebreak-ext=md] + - id: detect-private-key + stages: [pre-commit] + - repo: https://github.com/pre-commit/mirrors-clang-format + rev: v22.1.0 hooks: - id: clang-format - args: [--style=file, -i] + stages: [pre-commit] - repo: https://github.com/iconmaster5326/cmake-format-pre-commit-hook rev: v0.6.13 hooks: - id: cmake-format + stages: [pre-commit] - repo: https://github.com/adrienverge/yamllint.git rev: v1.37.1 hooks: - id: yamllint + stages: [pre-commit] args: [--format, parsable, -d, relaxed] - repo: https://github.com/jumanjihouse/pre-commit-hook-yamlfmt rev: 0.2.3 hooks: - id: yamlfmt + stages: [pre-commit] + # typos uses typos.toml to find and fix typos + - repo: https://github.com/crate-ci/typos + rev: v1.44.0 + hooks: + - id: typos + stages: [pre-commit] + - repo: https://github.com/shellcheck-py/shellcheck-py + rev: v0.11.0.1 + hooks: + - id: shellcheck + stages: [pre-commit] + exclude: \.envrc + args: [--severity=warning] + - repo: https://github.com/scop/pre-commit-shfmt + rev: v3.12.0-2 + hooks: + - id: shfmt + stages: [pre-commit] + args: [--indent=4, --simplify, --write] + # markdownlint-cli uses .markdownlint.yaml to lint markdown files + - repo: https://github.com/igorshubovych/markdownlint-cli + rev: v0.48.0 + hooks: + - id: markdownlint-docker + stages: [pre-commit] + args: [--fix] + +default_install_hook_types: [pre-commit] diff --git a/.vscode/c_cpp_properties.json b/.vscode/c_cpp_properties.json index 3e0a481..a2b19d9 100644 --- a/.vscode/c_cpp_properties.json +++ b/.vscode/c_cpp_properties.json @@ -1,18 +1,18 @@ { - "configurations": [ - { - "name": "Linux", - "includePath": [ - "${workspaceFolder}/**" - ], - "defines": [], - "compilerPath": "/usr/bin/clang", - "cStandard": "c17", - "cppStandard": "c++17", - "intelliSenseMode": "linux-clang-x64", - "compileCommands": "${workspaceFolder}/build/compile_commands.json", - "configurationProvider": "ms-vscode.cmake-tools" - } - ], - "version": 4 + "configurations": [ + { + "name": "Linux", + "includePath": [ + "${workspaceFolder}/**" + ], + "defines": [], + "compilerPath": "/usr/bin/clang", + "cStandard": "c17", + "cppStandard": "c++17", + "intelliSenseMode": "linux-clang-x64", + "compileCommands": "${workspaceFolder}/build/compile_commands.json", + "configurationProvider": "ms-vscode.cmake-tools" + } + ], + "version": 4 } diff --git a/.vscode/extensions.json b/.vscode/extensions.json index f18f1b8..0515580 100644 --- a/.vscode/extensions.json +++ b/.vscode/extensions.json @@ -1,17 +1,17 @@ { - "recommendations": [ - "llvm-vs-code-extensions.vscode-clangd", - "vadimcn.vscode-lldb", - "ms-vscode.cpptools", - "ms-vscode.cmake-tools", - "twxs.cmake", - "jeff-hykin.better-cpp-syntax", - "ms-python.python", - "ms-python.autopep8", - "xaver.clang-format", - "matepek.vscode-catch2-test-adapter", - "jnoortheen.nix-ide", - "notskm.clang-tidy" - ], - "unwantedRecommendations": [] + "recommendations": [ + "llvm-vs-code-extensions.vscode-clangd", + "vadimcn.vscode-lldb", + "ms-vscode.cpptools", + "ms-vscode.cmake-tools", + "twxs.cmake", + "jeff-hykin.better-cpp-syntax", + "ms-python.python", + "ms-python.autopep8", + "xaver.clang-format", + "matepek.vscode-catch2-test-adapter", + "jnoortheen.nix-ide", + "notskm.clang-tidy" + ], + "unwantedRecommendations": [] } diff --git a/.vscode/launch.json b/.vscode/launch.json index 57e84c4..32ce52e 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -1,37 +1,37 @@ { - "version": "0.2.0", - "configurations": [ - { - "name": "Debug Unittests (GDB)", - "type": "gdb", - "request": "launch", - "target": "./build/tests/Debug/unittests", - "cwd": "${workspaceRoot}", - "valuesFormatting": "parseText" - }, - { - "name": "Debug coronan cli (GDB)", - "type": "gdb", - "request": "launch", - "target": "./build/apps/Debug/cli/coronan", - "cwd": "${workspaceRoot}", - "valuesFormatting": "parseText" - }, - { - "name": "Debug coronan Qt App (GDB)", - "type": "gdb", - "request": "launch", - "target": "./build/apps/Debug/qt/coronanApp", - "cwd": "${workspaceRoot}", - "valuesFormatting": "parseText" - }, - { - "name": "CMake Tools target (GDB)", - "type": "gdb", - "request": "launch", - "target": "${command:cmake.launchTargetPath}", - "cwd": "${workspaceRoot}", - "valuesFormatting": "parseText" - } - ] + "version": "0.2.0", + "configurations": [ + { + "name": "Debug Unittests (GDB)", + "type": "gdb", + "request": "launch", + "target": "./build/tests/Debug/unittests", + "cwd": "${workspaceRoot}", + "valuesFormatting": "parseText" + }, + { + "name": "Debug coronan cli (GDB)", + "type": "gdb", + "request": "launch", + "target": "./build/apps/Debug/cli/coronan", + "cwd": "${workspaceRoot}", + "valuesFormatting": "parseText" + }, + { + "name": "Debug coronan Qt App (GDB)", + "type": "gdb", + "request": "launch", + "target": "./build/apps/Debug/qt/coronanApp", + "cwd": "${workspaceRoot}", + "valuesFormatting": "parseText" + }, + { + "name": "CMake Tools target (GDB)", + "type": "gdb", + "request": "launch", + "target": "${command:cmake.launchTargetPath}", + "cwd": "${workspaceRoot}", + "valuesFormatting": "parseText" + } + ] } diff --git a/.vscode/settings.json b/.vscode/settings.json index edccdec..64e21b6 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,17 +1,17 @@ { - "restructuredtext.confPath": "${workspaceFolder}/docs", - "gcovViewer.buildDirectories": [ - "/workspace/Coronan/build" - ], - "testMate.cpp.test.executables": "{build,Build,BUILD,out,Out,OUT}/tests/{Debug,release}/unittests", - "editor.bracketPairColorization.enabled": true, - "editor.guides.bracketPairs": "active", - "cSpell.words": [ - "cmake", - "coronan", - "cppcheck", - "Doxygen", - "gitpod", - "intermodular" - ] + "restructuredtext.confPath": "${workspaceFolder}/docs", + "gcovViewer.buildDirectories": [ + "/workspace/Coronan/build" + ], + "testMate.cpp.test.executables": "{build,Build,BUILD,out,Out,OUT}/tests/{Debug,release}/unittests", + "editor.bracketPairColorization.enabled": true, + "editor.guides.bracketPairs": "active", + "cSpell.words": [ + "cmake", + "coronan", + "cppcheck", + "Doxygen", + "gitpod", + "intermodular" + ] } diff --git a/.vscode/tasks.json b/.vscode/tasks.json index 152d8ae..1e6a755 100644 --- a/.vscode/tasks.json +++ b/.vscode/tasks.json @@ -1,135 +1,135 @@ { - "version": "2.0.0", - "tasks": [ + "version": "2.0.0", + "tasks": [ + { + "label": "conan install", + "command": "conan", + "args": [ + "install", + ".", + "--build=missing", + "--settings", + "build_type=${input:buildType}", + "--settings", + "compiler=${input:compiler}", + "--settings", + "compiler.version=${input:compilerversion}", + "--settings", + "compiler.cppstd=gnu17", + "--settings", + "compiler.libcxx=libstdc++11", + "--update" + ], + "group": { + "kind": "build", + "isDefault": false + }, + "options": { + "cwd": "${workspaceFolder}/" + }, + "type": "shell", + "presentation": { + "clear": true + } + }, + { + "label": "build", + "command": "cmake --build build", + "group": { + "kind": "build", + "isDefault": true + }, + "problemMatcher": { + "base": "$gcc" + }, + "options": { + "cwd": "${workspaceFolder}/" + }, + "type": "shell", + "presentation": { + "clear": true + } + }, + { + "label": "clean", + "command": "/usr/bin/rm -rf build", + "group": "build", + "problemMatcher": [], + "type": "shell" + }, + { + "label": "unittests", + "command": "cmake --build --preset=run-unittests", + "group": { + "isDefault": true, + "kind": "test" + }, + "options": { + "cwd": "${workspaceFolder}" + }, + "problemMatcher": [], + "type": "shell" + }, + { + "label": "format files", + "command": "./format_source_files.sh", + "problemMatcher": [], + "type": "shell" + }, + { + "label": "run pre-commit hooks", + "command": "pre-commit run --all-files", + "problemMatcher": [], + "type": "shell" + } + ], + "inputs": [ + { + "id": "buildType", + "type": "pickString", + "description": "Choose an option", + "options": [ + "Debug", + "Release" + ] + }, + { + "id": "compiler", + "type": "pickString", + "description": "Choose an option", + "options": [ { - "label": "conan install", - "command": "conan", - "args": [ - "install", - ".", - "--build=missing", - "--settings", - "build_type=${input:buildType}", - "--settings", - "compiler=${input:compiler}", - "--settings", - "compiler.version=${input:compilerversion}", - "--settings", - "compiler.cppstd=gnu17", - "--settings", - "compiler.libcxx=libstdc++11", - "--update" - ], - "group": { - "kind": "build", - "isDefault": false - }, - "options": { - "cwd": "${workspaceFolder}/" - }, - "type": "shell", - "presentation": { - "clear": true - } + "label": "GCC", + "value": "gcc" }, { - "label": "build", - "command": "cmake --build build", - "group": { - "kind": "build", - "isDefault": true - }, - "problemMatcher": { - "base": "$gcc" - }, - "options": { - "cwd": "${workspaceFolder}/" - }, - "type": "shell", - "presentation": { - "clear": true - } - }, - { - "label": "clean", - "command": "/usr/bin/rm -rf build", - "group": "build", - "problemMatcher": [], - "type": "shell" - }, - { - "label": "unittests", - "command": "cmake --build --preset=run-unittests", - "group": { - "isDefault": true, - "kind": "test" - }, - "options": { - "cwd": "${workspaceFolder}" - }, - "problemMatcher": [], - "type": "shell" - }, + "label": "Clang", + "value": "clang" + } + ] + }, + { + "id": "compilerversion", + "type": "pickString", + "description": "Choose an option", + "options": [ { - "label": "format files", - "command": "./format_source_files.sh", - "problemMatcher": [], - "type": "shell" + "label": "13 (gcc)", + "value": "13" }, { - "label": "run pre-commit hooks", - "command": "pre-commit run --all-files", - "problemMatcher": [], - "type": "shell" - } - ], - "inputs": [ - { - "id": "buildType", - "type": "pickString", - "description": "Choose an option", - "options": [ - "Debug", - "Release" - ] + "label": "14 (gcc)", + "value": "14" }, { - "id": "compiler", - "type": "pickString", - "description": "Choose an option", - "options": [ - { - "label": "GCC", - "value": "gcc" - }, - { - "label": "Clang", - "value": "clang" - } - ] + "label": "18 (clang)", + "value": "18" }, { - "id": "compilerversion", - "type": "pickString", - "description": "Choose an option", - "options": [ - { - "label": "13 (gcc)", - "value": "13" - }, - { - "label": "14 (gcc)", - "value": "14" - }, - { - "label": "18 (clang)", - "value": "18" - }, - { - "label": "19 (clang)", - "value": "19" - } - ] + "label": "19 (clang)", + "value": "19" } - ] + ] + } + ] } diff --git a/CMakePresets.json b/CMakePresets.json index 3decfdd..1a2cc1e 100644 --- a/CMakePresets.json +++ b/CMakePresets.json @@ -1,452 +1,452 @@ { - "version": 6, - "cmakeMinimumRequired": { - "major": 3, - "minor": 25, - "patch": 0 - }, - "configurePresets": [ - { - "name": "base", - "binaryDir": "${sourceDir}/build", - "cacheVariables": { - "ENABLE_TESTING": { - "type": "BOOL", - "value": true - } - }, - "hidden": true - }, - { - "name": "debug", - "description": "Configure debug build", - "cacheVariables": { - "CMAKE_BUILD_TYPE": "Debug", - "CMAKE_PREFIX_PATH": { - "type": "FILEPATH", - "value": "${sourceDir}/build/Debug/generators" - } - }, - "hidden": true - }, - { - "name": "pch", - "description": "Enable precompiled headers", - "cacheVariables": { - "ENABLE_PCH": { - "type": "BOOL", - "value": true - }, - "ENABLE_CLANG_TIDY": { - "type": "BOOL", - "value": false - } - }, - "hidden": true - }, - { - "name": "coverage", - "description": "Configure coverage", - "inherits": [ - "debug" - ], - "cacheVariables": { - "ENABLE_COVERAGE": { - "type": "BOOL", - "value": true - } - }, - "hidden": true - }, - { - "name": "release", - "description": "Configure release build", - "cacheVariables": { - "CMAKE_BUILD_TYPE": "Release", - "CMAKE_PREFIX_PATH": { - "type": "FILEPATH", - "value": "${sourceDir}/build/Release/generators" - } - }, - "hidden": true - }, - { - "name": "linux-gcc", - "description": "Configure gnu (Ninja)", - "generator": "Ninja Multi-Config", - "inherits": [ - "base" - ], - "cacheVariables": { - "CMAKE_CXX_COMPILER": "g++", - "CMAKE_C_COMPILER": "gcc" - }, - "hidden": true - }, - { - "name": "linux-clang", - "description": "Configure clang (Ninja)", - "generator": "Ninja Multi-Config", - "inherits": [ - "base" - ], - "cacheVariables": { - "CMAKE_CXX_COMPILER": "clang++", - "CMAKE_C_COMPILER": "clang" - }, - "hidden": true - }, - { - "name": "linux-gcc-coverage", - "displayName": "Coverage (gnu)", - "description": "Configure Coverage (gnu)", - "hidden": false, - "inherits": [ - "linux-gcc", - "coverage" - ] - }, - { - "name": "linux-gcc-debug", - "displayName": "Debug (gnu)", - "description": "Configure Debug (gnu)", - "hidden": false, - "inherits": [ - "linux-gcc", - "debug", - "pch" - ] - }, - { - "name": "linux-gcc-release", - "displayName": "Release (gnu)", - "description": "Configure Release (gnu)", - "hidden": false, - "inherits": [ - "linux-gcc", - "release", - "pch" - ] - }, - { - "name": "linux-clang-coverage", - "displayName": "Coverage (clang)", - "description": "Configure Coverage (clang)", - "hidden": false, - "inherits": [ - "linux-clang", - "coverage" - ] - }, - { - "name": "linux-clang-debug", - "displayName": "Debug (clang)", - "description": "Configure Debug (clang)", - "hidden": false, - "inherits": [ - "linux-clang", - "debug", - "pch" - ] - }, - { - "name": "linux-clang-release", - "displayName": "Release (clang)", - "description": "Configure Release (clang)", - "hidden": false, - "inherits": [ - "linux-clang", - "release", - "pch" - ] - }, - { - "name": "linux-clang-address-sanitizers", - "description": "Configure clang build with address sanitizers", - "displayName": "Address sanitizers", - "hidden": false, - "inherits": [ - "linux-clang", - "debug" - ], - "cacheVariables": { - "ENABLE_SANITIZERS": { - "type": "BOOL", - "value": true - }, - "ENABLE_SANITIZER_ADDRESS": { - "type": "BOOL", - "value": true - }, - "ENABLE_SANITIZER_LEAK": { - "type": "BOOL", - "value": true - }, - "ENABLE_SANITIZER_UNDEFINED_BEHAVIOR": { - "type": "BOOL", - "value": true - } - } - }, - { - "name": "linux-clang-memory-sanitizers", - "description": "Configure clang build with memory sanitizers", - "displayName": "Memory sanitizers", - "hidden": false, - "inherits": [ - "linux-clang", - "debug" - ], - "cacheVariables": { - "ENABLE_SANITIZERS": { - "type": "BOOL", - "value": true - }, - "ENABLE_SANITIZER_MEMORY": { - "type": "BOOL", - "value": true - } - } - }, - { - "name": "visual-studio-2022", - "description": "Configure Visual Studio 2022 build", - "generator": "Visual Studio 17 2022", - "inherits": [ - "base" - ], - "hidden": true - }, - { - "name": "visual-studio-2022-debug", - "displayName": "Visual Studio 2022 (Debug)", - "description": "Configure Visual Studio 2022 Debug build", - "hidden": false, - "inherits": [ - "visual-studio-2022", - "debug" - ] - }, - { - "name": "visual-studio-2022-release", - "displayName": "Visual Studio 2022 (Release)", - "description": "Configure Visual Studio 2022 Release build", - "hidden": false, - "inherits": [ - "visual-studio-2022", - "release" - ] + "version": 6, + "cmakeMinimumRequired": { + "major": 3, + "minor": 25, + "patch": 0 + }, + "configurePresets": [ + { + "name": "base", + "binaryDir": "${sourceDir}/build", + "cacheVariables": { + "ENABLE_TESTING": { + "type": "BOOL", + "value": true } - ], - "buildPresets": [ - { - "name": "gcc-debug", - "description": "gcc debug build.", - "displayName": "Debug", - "configurePreset": "linux-gcc-debug", - "configuration": "Debug", - "jobs": 16 - }, - { - "name": "gcc-coverage", - "description": "gcc debug with coverage.", - "displayName": "Coverage", - "configurePreset": "linux-gcc-coverage", - "configuration": "Debug", - "jobs": 16 - }, - { - "name": "gcc-release", - "description": "gcc release build.", - "displayName": "Release", - "configurePreset": "linux-gcc-release", - "configuration": "Release", - "jobs": 16 - }, - { - "name": "clang-debug", - "description": "clang debug build.", - "displayName": "Debug", - "configurePreset": "linux-clang-debug", - "configuration": "Debug", - "jobs": 16 - }, - { - "name": "clang-coverage", - "description": "clang debug with coverage.", - "displayName": "Coverage", - "configurePreset": "linux-clang-coverage", - "configuration": "Debug", - "jobs": 16 - }, - { - "name": "clang-release", - "description": "clang release build.", - "displayName": "Release", - "configurePreset": "linux-clang-release", - "configuration": "Release", - "jobs": 16 - }, - { - "name": "clang-address-sanitizers", - "description": "clang address sanitizers build.", - "displayName": "Address Sanitizers", - "configurePreset": "linux-clang-address-sanitizers", - "configuration": "Debug", - "jobs": 16 - }, - { - "name": "clang-memory-sanitizers", - "description": "clang memory sanitizers build.", - "displayName": "Memory Sanitizers", - "configurePreset": "linux-clang-memory-sanitizers", - "configuration": "Debug", - "jobs": 16 - }, - { - "name": "visual-studio-debug", - "description": "Visual Studio 2022 Debug build.", - "displayName": "Debug (Visual Studio)", - "configurePreset": "visual-studio-2022-debug", - "configuration": "Debug", - "jobs": 16 - }, - { - "name": "visual-studio-release", - "description": "Visual Studio 2022 Release build.", - "displayName": "Release (Visual Studio)", - "configurePreset": "visual-studio-2022-release", - "configuration": "Release", - "jobs": 16 - }, - { - "name": "run-unittests", - "description": "Unittests", - "displayName": "run unit tests", - "inherits": "gcc-coverage", - "targets": [ - "run_unittests" - ] - }, - { - "name": "doc", - "description": "gcc docu build.", - "displayName": "Documentation (linux)", - "configurePreset": "linux-gcc-release", - "configuration": "Release", - "jobs": 16, - "targets": [ - "doxygen-docs" - ] - }, - { - "name": "doc-windows", - "description": "windows docu build.", - "displayName": "Documentation (win)", - "configurePreset": "visual-studio-2022-release", - "configuration": "Release", - "jobs": 16, - "targets": [ - "doxygen-docs" - ] + }, + "hidden": true + }, + { + "name": "debug", + "description": "Configure debug build", + "cacheVariables": { + "CMAKE_BUILD_TYPE": "Debug", + "CMAKE_PREFIX_PATH": { + "type": "FILEPATH", + "value": "${sourceDir}/build/Debug/generators" } - ], - "testPresets": [ - { - "name": "unittest-coverage-gcc", - "description": "Unittest with coverage (gcc)", - "displayName": "Unittest Coverage", - "configurePreset": "linux-gcc-coverage" - }, - { - "name": "unittest-gcc", - "description": "Unittest (gcc)", - "displayName": "Unittest", - "configurePreset": "linux-gcc-debug" - }, - { - "name": "unittest-coverage-clang", - "description": "Unittest with coverage (clang)", - "displayName": "Unittest Coverage", - "configurePreset": "linux-clang-coverage" - }, - { - "name": "unittest-clang", - "description": "Unittest (clang)", - "displayName": "Unittest", - "configurePreset": "linux-clang-debug" - }, - { - "name": "unittest-vs-2022", - "description": "Unittest (Visual Studio", - "displayName": "Unittest", - "configurePreset": "visual-studio-2022-debug" + }, + "hidden": true + }, + { + "name": "pch", + "description": "Enable precompiled headers", + "cacheVariables": { + "ENABLE_PCH": { + "type": "BOOL", + "value": true + }, + "ENABLE_CLANG_TIDY": { + "type": "BOOL", + "value": false } - ], - "packagePresets": [ - { - "name": "tgz-gcc", - "displayName": "Tar GZip", - "configurePreset": "linux-gcc-release", - "generators": [ - "TGZ" - ] - }, - { - "name": "tgz-clang", - "displayName": "Tar GZip", - "configurePreset": "linux-clang-release", - "generators": [ - "TGZ" - ] - }, - { - "name": "debian-gcc", - "displayName": "Debian package", - "configurePreset": "linux-gcc-release", - "generators": [ - "DEB" - ] - }, - { - "name": "debian-clang", - "displayName": "Debian package", - "configurePreset": "linux-clang-release", - "generators": [ - "DEB" - ] - }, - { - "name": "ifw-gcc", - "displayName": "Qt installer", - "configurePreset": "linux-gcc-release", - "generators": [ - "IFW" - ] - }, - { - "name": "ifw-gclang", - "displayName": "Qt installer", - "configurePreset": "linux-clang-release", - "generators": [ - "IFW" - ] - }, - { - "name": "ifw-visual-studio-2022", - "displayName": "Windows IFW", - "configurePreset": "visual-studio-2022-release", - "generators": [ - "IFW" - ] - }, - { - "name": "wix-visual-studio-2022", - "displayName": "Windows Wix", - "configurePreset": "visual-studio-2022-release", - "generators": [ - "WIX" - ] + }, + "hidden": true + }, + { + "name": "coverage", + "description": "Configure coverage", + "inherits": [ + "debug" + ], + "cacheVariables": { + "ENABLE_COVERAGE": { + "type": "BOOL", + "value": true + } + }, + "hidden": true + }, + { + "name": "release", + "description": "Configure release build", + "cacheVariables": { + "CMAKE_BUILD_TYPE": "Release", + "CMAKE_PREFIX_PATH": { + "type": "FILEPATH", + "value": "${sourceDir}/build/Release/generators" } - ] + }, + "hidden": true + }, + { + "name": "linux-gcc", + "description": "Configure gnu (Ninja)", + "generator": "Ninja Multi-Config", + "inherits": [ + "base" + ], + "cacheVariables": { + "CMAKE_CXX_COMPILER": "g++", + "CMAKE_C_COMPILER": "gcc" + }, + "hidden": true + }, + { + "name": "linux-clang", + "description": "Configure clang (Ninja)", + "generator": "Ninja Multi-Config", + "inherits": [ + "base" + ], + "cacheVariables": { + "CMAKE_CXX_COMPILER": "clang++", + "CMAKE_C_COMPILER": "clang" + }, + "hidden": true + }, + { + "name": "linux-gcc-coverage", + "displayName": "Coverage (gnu)", + "description": "Configure Coverage (gnu)", + "hidden": false, + "inherits": [ + "linux-gcc", + "coverage" + ] + }, + { + "name": "linux-gcc-debug", + "displayName": "Debug (gnu)", + "description": "Configure Debug (gnu)", + "hidden": false, + "inherits": [ + "linux-gcc", + "debug", + "pch" + ] + }, + { + "name": "linux-gcc-release", + "displayName": "Release (gnu)", + "description": "Configure Release (gnu)", + "hidden": false, + "inherits": [ + "linux-gcc", + "release", + "pch" + ] + }, + { + "name": "linux-clang-coverage", + "displayName": "Coverage (clang)", + "description": "Configure Coverage (clang)", + "hidden": false, + "inherits": [ + "linux-clang", + "coverage" + ] + }, + { + "name": "linux-clang-debug", + "displayName": "Debug (clang)", + "description": "Configure Debug (clang)", + "hidden": false, + "inherits": [ + "linux-clang", + "debug", + "pch" + ] + }, + { + "name": "linux-clang-release", + "displayName": "Release (clang)", + "description": "Configure Release (clang)", + "hidden": false, + "inherits": [ + "linux-clang", + "release", + "pch" + ] + }, + { + "name": "linux-clang-address-sanitizers", + "description": "Configure clang build with address sanitizers", + "displayName": "Address sanitizers", + "hidden": false, + "inherits": [ + "linux-clang", + "debug" + ], + "cacheVariables": { + "ENABLE_SANITIZERS": { + "type": "BOOL", + "value": true + }, + "ENABLE_SANITIZER_ADDRESS": { + "type": "BOOL", + "value": true + }, + "ENABLE_SANITIZER_LEAK": { + "type": "BOOL", + "value": true + }, + "ENABLE_SANITIZER_UNDEFINED_BEHAVIOR": { + "type": "BOOL", + "value": true + } + } + }, + { + "name": "linux-clang-memory-sanitizers", + "description": "Configure clang build with memory sanitizers", + "displayName": "Memory sanitizers", + "hidden": false, + "inherits": [ + "linux-clang", + "debug" + ], + "cacheVariables": { + "ENABLE_SANITIZERS": { + "type": "BOOL", + "value": true + }, + "ENABLE_SANITIZER_MEMORY": { + "type": "BOOL", + "value": true + } + } + }, + { + "name": "visual-studio-2022", + "description": "Configure Visual Studio 2022 build", + "generator": "Visual Studio 17 2022", + "inherits": [ + "base" + ], + "hidden": true + }, + { + "name": "visual-studio-2022-debug", + "displayName": "Visual Studio 2022 (Debug)", + "description": "Configure Visual Studio 2022 Debug build", + "hidden": false, + "inherits": [ + "visual-studio-2022", + "debug" + ] + }, + { + "name": "visual-studio-2022-release", + "displayName": "Visual Studio 2022 (Release)", + "description": "Configure Visual Studio 2022 Release build", + "hidden": false, + "inherits": [ + "visual-studio-2022", + "release" + ] + } + ], + "buildPresets": [ + { + "name": "gcc-debug", + "description": "gcc debug build.", + "displayName": "Debug", + "configurePreset": "linux-gcc-debug", + "configuration": "Debug", + "jobs": 16 + }, + { + "name": "gcc-coverage", + "description": "gcc debug with coverage.", + "displayName": "Coverage", + "configurePreset": "linux-gcc-coverage", + "configuration": "Debug", + "jobs": 16 + }, + { + "name": "gcc-release", + "description": "gcc release build.", + "displayName": "Release", + "configurePreset": "linux-gcc-release", + "configuration": "Release", + "jobs": 16 + }, + { + "name": "clang-debug", + "description": "clang debug build.", + "displayName": "Debug", + "configurePreset": "linux-clang-debug", + "configuration": "Debug", + "jobs": 16 + }, + { + "name": "clang-coverage", + "description": "clang debug with coverage.", + "displayName": "Coverage", + "configurePreset": "linux-clang-coverage", + "configuration": "Debug", + "jobs": 16 + }, + { + "name": "clang-release", + "description": "clang release build.", + "displayName": "Release", + "configurePreset": "linux-clang-release", + "configuration": "Release", + "jobs": 16 + }, + { + "name": "clang-address-sanitizers", + "description": "clang address sanitizers build.", + "displayName": "Address Sanitizers", + "configurePreset": "linux-clang-address-sanitizers", + "configuration": "Debug", + "jobs": 16 + }, + { + "name": "clang-memory-sanitizers", + "description": "clang memory sanitizers build.", + "displayName": "Memory Sanitizers", + "configurePreset": "linux-clang-memory-sanitizers", + "configuration": "Debug", + "jobs": 16 + }, + { + "name": "visual-studio-debug", + "description": "Visual Studio 2022 Debug build.", + "displayName": "Debug (Visual Studio)", + "configurePreset": "visual-studio-2022-debug", + "configuration": "Debug", + "jobs": 16 + }, + { + "name": "visual-studio-release", + "description": "Visual Studio 2022 Release build.", + "displayName": "Release (Visual Studio)", + "configurePreset": "visual-studio-2022-release", + "configuration": "Release", + "jobs": 16 + }, + { + "name": "run-unittests", + "description": "Unittests", + "displayName": "run unit tests", + "inherits": "gcc-coverage", + "targets": [ + "run_unittests" + ] + }, + { + "name": "doc", + "description": "gcc docu build.", + "displayName": "Documentation (linux)", + "configurePreset": "linux-gcc-release", + "configuration": "Release", + "jobs": 16, + "targets": [ + "doxygen-docs" + ] + }, + { + "name": "doc-windows", + "description": "windows docu build.", + "displayName": "Documentation (win)", + "configurePreset": "visual-studio-2022-release", + "configuration": "Release", + "jobs": 16, + "targets": [ + "doxygen-docs" + ] + } + ], + "testPresets": [ + { + "name": "unittest-coverage-gcc", + "description": "Unittest with coverage (gcc)", + "displayName": "Unittest Coverage", + "configurePreset": "linux-gcc-coverage" + }, + { + "name": "unittest-gcc", + "description": "Unittest (gcc)", + "displayName": "Unittest", + "configurePreset": "linux-gcc-debug" + }, + { + "name": "unittest-coverage-clang", + "description": "Unittest with coverage (clang)", + "displayName": "Unittest Coverage", + "configurePreset": "linux-clang-coverage" + }, + { + "name": "unittest-clang", + "description": "Unittest (clang)", + "displayName": "Unittest", + "configurePreset": "linux-clang-debug" + }, + { + "name": "unittest-vs-2022", + "description": "Unittest (Visual Studio", + "displayName": "Unittest", + "configurePreset": "visual-studio-2022-debug" + } + ], + "packagePresets": [ + { + "name": "tgz-gcc", + "displayName": "Tar GZip", + "configurePreset": "linux-gcc-release", + "generators": [ + "TGZ" + ] + }, + { + "name": "tgz-clang", + "displayName": "Tar GZip", + "configurePreset": "linux-clang-release", + "generators": [ + "TGZ" + ] + }, + { + "name": "debian-gcc", + "displayName": "Debian package", + "configurePreset": "linux-gcc-release", + "generators": [ + "DEB" + ] + }, + { + "name": "debian-clang", + "displayName": "Debian package", + "configurePreset": "linux-clang-release", + "generators": [ + "DEB" + ] + }, + { + "name": "ifw-gcc", + "displayName": "Qt installer", + "configurePreset": "linux-gcc-release", + "generators": [ + "IFW" + ] + }, + { + "name": "ifw-gclang", + "displayName": "Qt installer", + "configurePreset": "linux-clang-release", + "generators": [ + "IFW" + ] + }, + { + "name": "ifw-visual-studio-2022", + "displayName": "Windows IFW", + "configurePreset": "visual-studio-2022-release", + "generators": [ + "IFW" + ] + }, + { + "name": "wix-visual-studio-2022", + "displayName": "Windows Wix", + "configurePreset": "visual-studio-2022-release", + "generators": [ + "WIX" + ] + } + ] } diff --git a/README.md b/README.md index 0cf6e1b..900fdf8 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,6 @@ ![version](https://img.shields.io/badge/version-v1.0.0-blue) ![GitHub last commit](https://img.shields.io/github/last-commit/bbvch/Coronan) - [![Linux Builds](https://github.com/bbvch/Coronan/actions/workflows/ci-linux.yml/badge.svg)](https://github.com/bbvch/Coronan/actions/workflows/ci-linux.yml) [![Nix Builds](https://github.com/bbvch/Coronan/actions/workflows/nix.yml/badge.svg)](https://github.com/bbvch/Coronan/actions/workflows/nix.yml) @@ -34,12 +33,10 @@ [![Coverage](https://sonarcloud.io/api/project_badges/measure?project=bbvch_Coronan&metric=coverage)](https://sonarcloud.io/summary/overall?id=bbvch_Coronan) [![Duplicated Lines (%)](https://sonarcloud.io/api/project_badges/measure?project=bbvch_Coronan&metric=duplicated_lines_density)](https://sonarcloud.io/summary/overall?id=bbvch_Coronan) - - [![Open in Gitpod](https://gitpod.io/button/open-in-gitpod.svg)](https://gitpod.io/#https://github.com/bbvch/Coronan) - ### IMPORTANT NOTE + Co\[ro\]nan was written during the pandemic of the Corona Virus. The [The About Corona Covid-19 API](https://about-corona.net/documentation) used for the first version is no longer available. However with [COVID-19 Statistics API](https://covid-api.com/) an alternative was found. Unfortunately the [COVID-19 Statistics API](https://covid-api.com/api/) does have a different data structure, and retrieving data is much slower, because the API does not support timeline data, i.e. every data for specific date requires a GET. But at least the application works again. And the name didn't have to change. @@ -49,13 +46,10 @@ Co\[ro\]nan was written during the pandemic of the Corona Virus. The [The About Co\[ro\]nan is an example C++20 CLI and Qt project using [conan](https://conan.io/) and [CMake](https://cmake.org/). It reads the latest data of Corona (Covid-19) cases for a country from the [COVID-19 Statistics API](https://covid-api.com/). - _The COVID-19 Statistics API_ provides statistics via REST API from the [Johns Hopkins CSSE](https://github.com/CSSEGISandData/COVID-19). - ![Screenshot of the qt application](images/Screenshot-qt.png) - ## Table of content
@@ -75,100 +69,101 @@ _The COVID-19 Statistics API_ provides statistics via REST API from the [Johns H ## Project Features This projects is a C++ project template. It includes everything a "Modern" C++ project possibly needs: -* C++ 20 Standard - * [GCC](https://gcc.gnu.org/) _(>= gcc-12)_ - * [Clang](https://clang.llvm.org/) _(>= clang-13)_ - * Visual Studio 2022 -* [conan](https://conan.io/) package Manager +- C++ 20 Standard + - [GCC](https://gcc.gnu.org/) _(>= gcc-12)_ + - [Clang](https://clang.llvm.org/) _(>= clang-13)_ + - Visual Studio 2022 + +- [conan](https://conan.io/) package Manager -* Dependencies: - * to install: - * [Qt6](https://www.qt.io/) _(minimal version required: 6.4)_ - * with conan: - * [Poco](https://pocoproject.org/) Networking library - * [RapidJSON](https://rapidjson.org/) - * [Lyra](https://github.com/bfgroup/Lyra) command line arguments parser - * [{fmt}](https://github.com/fmtlib/fmt) formatting library _(std::print is C++23 and therefore not used yet)_ - * [date](https://github.com/HowardHinnant/date) date and time library _(std::chrono::year_month_day is not fully supported in older c++20 compilers (gcc 12, 13 and clang 13-16) therefor it is not used yet)_ - * [Catch2](https://github.com/catchorg/Catch2) _(for unittests)__ +- Dependencies: + - to install: + - [Qt6](https://www.qt.io/) _(minimal version required: 6.4)_ + - with conan: + - [Poco](https://pocoproject.org/) Networking library + - [RapidJSON](https://rapidjson.org/) + - [Lyra](https://github.com/bfgroup/Lyra) command line arguments parser + - [{fmt}](https://github.com/fmtlib/fmt) formatting library _(std::print is C++23 and therefore not used yet)_ + - [date](https://github.com/HowardHinnant/date) date and time library _(std::chrono::year_month_day is not fully supported in older c++20 compilers (gcc 12, 13 and clang 13-16) therefor it is not used yet)_ + - [Catch2](https://github.com/catchorg/Catch2) _(for unittests)__ -* Unittests with Coverage using [Catch2](https://github.com/catchorg/Catch2) +- Unittests with Coverage using [Catch2](https://github.com/catchorg/Catch2) -* CMake with [CMakePresets](https://cmake.org/cmake/help/latest/manual/cmake-presets.7.html) _(CMake >= 3.23)_ +- CMake with [CMakePresets](https://cmake.org/cmake/help/latest/manual/cmake-presets.7.html) _(CMake >= 3.23)_ -* CPack packaging: - * tar gzip archive - * Debian package - * [Qt Installer Framework](https://doc.qt.io/qtinstallerframework/) - * [WIX](https://wixtoolset.org/) +- CPack packaging: + - tar gzip archive + - Debian package + - [Qt Installer Framework](https://doc.qt.io/qtinstallerframework/) + - [WIX](https://wixtoolset.org/) -* Build Caching support: - * [ccache](https://ccache.dev/) - * [sccache](https://github.com/mozilla/sccache) +- Build Caching support: + - [ccache](https://ccache.dev/) + - [sccache](https://github.com/mozilla/sccache) -* Static Analyzer support: - * [clang-tidy](https://clang.llvm.org/extra/clang-tidy/) - * [cppcheck](http://cppcheck.sourceforge.net/) - * [include-what-you-use](https://include-what-you-use.org/) - * [link-what-you-use](https://cmake.org/cmake/help/latest/prop_tgt/LINK_WHAT_YOU_USE.html) +- Static Analyzer support: + - [clang-tidy](https://clang.llvm.org/extra/clang-tidy/) + - [cppcheck](http://cppcheck.sourceforge.net/) + - [include-what-you-use](https://include-what-you-use.org/) + - [link-what-you-use](https://cmake.org/cmake/help/latest/prop_tgt/LINK_WHAT_YOU_USE.html) -* Sanitizers support: - * [Address Sanitizer](https://clang.llvm.org/docs/AddressSanitizer.html) - * [Leak Sanitizer](https://clang.llvm.org/docs/LeakSanitizer.html) - * [Undefined Behavior Sanitizer](https://clang.llvm.org/docs/UndefinedBehaviorSanitizer.html) - * [Thread Sanitizer](https://clang.llvm.org/docs/ThreadSanitizer.html) - * [Memory Sanitizer](https://clang.llvm.org/docs/MemorySanitizer.html) +- Sanitizers support: + - [Address Sanitizer](https://clang.llvm.org/docs/AddressSanitizer.html) + - [Leak Sanitizer](https://clang.llvm.org/docs/LeakSanitizer.html) + - [Undefined Behavior Sanitizer](https://clang.llvm.org/docs/UndefinedBehaviorSanitizer.html) + - [Thread Sanitizer](https://clang.llvm.org/docs/ThreadSanitizer.html) + - [Memory Sanitizer](https://clang.llvm.org/docs/MemorySanitizer.html) -* Documentation Generation using - * [Doxygen](https://www.doxygen.nl/index.html) using the _"doxygen-awesome-sidebar-only"_ theme by - * [doxygen-awesome-css](https://github.com/jothepro/doxygen-awesome-css) by default +- Documentation Generation using + - [Doxygen](https://www.doxygen.nl/index.html) using the _"doxygen-awesome-sidebar-only"_ theme by + - [doxygen-awesome-css](https://github.com/jothepro/doxygen-awesome-css) by default -* Code formatting: - * [clang-format](https://clang.llvm.org/docs/ClangFormat.html) for C++ files - * [cmake-format](https://pypi.org/project/cmake-format/) for CMake files +- Code formatting: + - [clang-format](https://clang.llvm.org/docs/ClangFormat.html) for C++ files + - [cmake-format](https://pypi.org/project/cmake-format/) for CMake files -* [Pre-commit-hooks](https://github.com/pre-commit/pre-commit-hooks) support +- [Pre-commit-hooks](https://github.com/pre-commit/pre-commit-hooks) support -* [Nix](https://nixos.org) environment support +- [Nix](https://nixos.org) environment support -* [gitpod](https://www.gitpod.io/) support +- [gitpod](https://www.gitpod.io/) support -* Continuous integration (CI): - * GitHub Action +- Continuous integration (CI): + - GitHub Action - * Mac OS X - * 13 _(AppleClang 14)_ - * 14 _(AppleClang 15)_ - * 15 _(AppleClang 15)_ + - Mac OS X + - 13 _(AppleClang 14)_ + - 14 _(AppleClang 15)_ + - 15 _(AppleClang 15)_ - * Ubuntu 22.04 - * GCC 12 - * Clang 13, 14 & 15 + - Ubuntu 22.04 + - GCC 12 + - Clang 13, 14 & 15 - * Ubuntu 24.04 - * GCC 13 & 14 - * Clang 16, 17 & 18 + - Ubuntu 24.04 + - GCC 13 & 14 + - Clang 16, 17 & 18 - * Windows - * Visual Studio 2022 + - Windows + - Visual Studio 2022 - * Nix - * GCC 14 - * Clang 18 + - Nix + - GCC 14 + - Clang 18 - * [Codacy Security Scan](https://github.com/marketplace/actions/codacy-analysis-cli) + - [Codacy Security Scan](https://github.com/marketplace/actions/codacy-analysis-cli) - * [CodeQL Static Analysis](https://github.com/github/codeql-action) + - [CodeQL Static Analysis](https://github.com/github/codeql-action) - * [Coverity Scan Static Analysis](https://scan.coverity.com/) + - [Coverity Scan Static Analysis](https://scan.coverity.com/) - * [Codecov](https://codecov.io) Coverage Reporter + - [Codecov](https://codecov.io) Coverage Reporter - * [Sonar Cloud Static Analysis](https://www.sonarsource.com/products/sonarcloud/) + - [Sonar Cloud Static Analysis](https://www.sonarsource.com/products/sonarcloud/) - * [AppVeyor](https://www.appveyor.com/) - * Windows Visual Studio 2019 + - [AppVeyor](https://www.appveyor.com/) + - Windows Visual Studio 2019 ## Development @@ -198,20 +193,22 @@ __CMake__: You can also build it yourself using CMake and conan -* __Install dependencies with conan__ +- __Install dependencies with conan__ ```bash conan install . --build=missing --settings build_type=Debug ``` + Because the conan [cmake_layout](https://docs.conan.io/2/reference/tools/cmake/cmake_layout.html#) and the [`CMakeDeps`](https://docs.conan.io/2/reference/tools/cmake/cmakedeps.html) generator is used, the necessary cmake files used with `find_packages()` are generated into `build\\generators`. `CMAKE_PREFIX_PATH` is adapted accordingly in the root `CMakeLists.txt`. -* __Without CMake Presets__ +- __Without CMake Presets__ ```bash cmake -S . -B ./build -DCMAKE_BUILD_TYPE=Debug cmake --build ./build ``` -* __With CMake Presets__ + +- __With CMake Presets__ ```bash cmake -S . --preset=linux-gcc-debug @@ -228,46 +225,46 @@ _Note: Delete the build directory before formatting, otherwise all CMake files i ### CMake options -* `DOWNLOAD_QT6`: Download and build Qt6 otherwise use installed. _Default: `OFF`_ -* `ENABLE_TESTING`: Build (and run) unittests. _Default: `ON`_ -* `ENABLE_BUILD_WITH_TIME_TRACE`: Enable [Clang Time Trace Feature](https://www.snsystems.com/technology/tech-blog/clang-time-trace-feature). _Default: `OFF`_ -* `ENABLE_PCH`: Enable [Precompiled Headers](https://en.wikipedia.org/wiki/Precompiled_header). _Default: `OFF`_ -* `ENABLE_CACHE`: Enable caching if available, e.g. [ccache](https://ccache.dev/) or [sccache](https://github.com/mozilla/sccache). _Default: `ON`_ -* `ENABLE_COVERAGE`: Enable coverage reporting for gcc/clang. _Default: `OFF`_ -* `ENABLE_DOXYGEN`: Enable doxygen documentation build ([Doxygen](https://www.doxygen.nl/index.html) must be installed). _Default: `ON` if Doxygen is installed `OFF` otherwise._ -* `ENABLE_SANITIZERS`: Enable supported sanitizers. _Default: `OFF`_ - * `ENABLE_SANITIZER_ADDRESS`: Enable [address sanitizer](https://clang.llvm.org/docs/AddressSanitizer.html). _Default: `ON` if supported by the compiler and `ENABLE_SANITIZERS` is `ON` otherwise `OFF`._ - * `ENABLE_SANITIZER_LEAK`: Enable [leak sanitizer](https://clang.llvm.org/docs/LeakSanitizer.html). _Default: `OFF`_ - * `ENABLE_SANITIZER_UNDEFINED_BEHAVIOR`: Enable [undefined behavior sanitizer](https://clang.llvm.org/docs/UndefinedBehaviorSanitizer.html). _Default: `ON` if supported by the compiler and `ENABLE_SANITIZERS` is `ON` otherwise `OFF`._ - * `ENABLE_SANITIZER_THREAD`: Enable [thread sanitizer](https://clang.llvm.org/docs/ThreadSanitizer.html). _Default: `OFF`_ - * `ENABLE_SANITIZER_MEMORY`: Enable [memory sanitizer](https://clang.llvm.org/docs/MemorySanitizer.html). _Default: `OFF`_ -* `ENABLE_IPO`: Enable intermodular optimization, aka [Link Time Optimization (LTO)](https://llvm.org/docs/LinkTimeOptimization.html). _Default: `OFF`_ -* `ENABLE_CPPCHECK`: Enable static analysis with [cppcheck](http://cppcheck.sourceforge.net/). _Default: `ON` if cppcheck is installed `OFF` otherwise._ -* `ENABLE_CLANG_TIDY`: Enable static analysis with [clang-tidy](https://clang.llvm.org/extra/clang-tidy/). _Default: `ON` if clang-tidy is installed `OFF` otherwise._ -* `ENABLE_INCLUDE_WHAT_YOU_USE`: Enable static analysis with [include-what-you-use](https://include-what-you-use.org/). _Default: `ON` if include-what-you-use is installed `OFF` otherwise_. -* `ENABLE_LINK_WHAT_YOU_USE` : Enable _link what you use_ cmake built-in static analysis. _Default: `OFF` -* `WARNINGS_AS_ERRORS`: Treat compiler warnings as errors. _Default: `OFF` +- `DOWNLOAD_QT6`: Download and build Qt6 otherwise use installed. _Default: `OFF`_ +- `ENABLE_TESTING`: Build (and run) unittests. _Default: `ON`_ +- `ENABLE_BUILD_WITH_TIME_TRACE`: Enable [Clang Time Trace Feature](https://www.snsystems.com/technology/tech-blog/clang-time-trace-feature). _Default: `OFF`_ +- `ENABLE_PCH`: Enable [Precompiled Headers](https://en.wikipedia.org/wiki/Precompiled_header). _Default: `OFF`_ +- `ENABLE_CACHE`: Enable caching if available, e.g. [ccache](https://ccache.dev/) or [sccache](https://github.com/mozilla/sccache). _Default: `ON`_ +- `ENABLE_COVERAGE`: Enable coverage reporting for gcc/clang. _Default: `OFF`_ +- `ENABLE_DOXYGEN`: Enable doxygen documentation build ([Doxygen](https://www.doxygen.nl/index.html) must be installed). _Default: `ON` if Doxygen is installed `OFF` otherwise._ +- `ENABLE_SANITIZERS`: Enable supported sanitizers. _Default: `OFF`_ + - `ENABLE_SANITIZER_ADDRESS`: Enable [address sanitizer](https://clang.llvm.org/docs/AddressSanitizer.html). _Default: `ON` if supported by the compiler and `ENABLE_SANITIZERS` is `ON` otherwise `OFF`._ + - `ENABLE_SANITIZER_LEAK`: Enable [leak sanitizer](https://clang.llvm.org/docs/LeakSanitizer.html). _Default: `OFF`_ + - `ENABLE_SANITIZER_UNDEFINED_BEHAVIOR`: Enable [undefined behavior sanitizer](https://clang.llvm.org/docs/UndefinedBehaviorSanitizer.html). _Default: `ON` if supported by the compiler and `ENABLE_SANITIZERS` is `ON` otherwise `OFF`._ + - `ENABLE_SANITIZER_THREAD`: Enable [thread sanitizer](https://clang.llvm.org/docs/ThreadSanitizer.html). _Default: `OFF`_ + - `ENABLE_SANITIZER_MEMORY`: Enable [memory sanitizer](https://clang.llvm.org/docs/MemorySanitizer.html). _Default: `OFF`_ +- `ENABLE_IPO`: Enable intermodular optimization, aka [Link Time Optimization (LTO)](https://llvm.org/docs/LinkTimeOptimization.html). _Default: `OFF`_ +- `ENABLE_CPPCHECK`: Enable static analysis with [cppcheck](http://cppcheck.sourceforge.net/). _Default: `ON` if cppcheck is installed `OFF` otherwise._ +- `ENABLE_CLANG_TIDY`: Enable static analysis with [clang-tidy](https://clang.llvm.org/extra/clang-tidy/). _Default: `ON` if clang-tidy is installed `OFF` otherwise._ +- `ENABLE_INCLUDE_WHAT_YOU_USE`: Enable static analysis with [include-what-you-use](https://include-what-you-use.org/). _Default: `ON` if include-what-you-use is installed `OFF` otherwise_. +- `ENABLE_LINK_WHAT_YOU_USE` : Enable _link what you use_ cmake built-in static analysis. _Default: `OFF` +- `WARNINGS_AS_ERRORS`: Treat compiler warnings as errors. _Default: `OFF` ## Pre-Commit Hooks The following [Pre-commit-hooks](https://github.com/pre-commit/pre-commit-hooks) are used to check and format files before committing: -* `check-added-large-files`: Prevent giant files (> 500kB) from being committed. -* `fix-byte-order-marker`: Forbid files which have a UTF-8 byte-order marker -* `check-case-conflict`: Check for files with names that would conflict on a case-insensitive filesystem like MacOS HFS+ or Windows FAT. -* `check-merge-conflict`: Check for files that contain merge conflict strings. -* `check-symlinks`: Checks for symlinks which do not point to anything. -* `check-yaml`: Attempts to load all yaml files to verify syntax. -* `check-json`: Attempts to load all json files to verify syntax. -* `check-toml`: Attempts to load all TOML files to verify syntax. -* `check-executables-have-shebangs`: Checks that non-binary executables have a proper shebang. -* `end-of-file-fixer`: Makes sure files end in a newline and only a newline. -* `mixed-line-ending`: Replaces or checks mixed line ending. -* `trailing-whitespace`: Trims trailing whitespace in markdown -* `clang-format`: Format C++ files using clang-format -* `cmake-format`: Format CMake files using cmake-format -* `yamllint`: Linter for yaml files -* `yamlfmt`: Format yaml files +- `check-added-large-files`: Prevent giant files (> 500kB) from being committed. +- `fix-byte-order-marker`: Forbid files which have a UTF-8 byte-order marker +- `check-case-conflict`: Check for files with names that would conflict on a case-insensitive filesystem like MacOS HFS+ or Windows FAT. +- `check-merge-conflict`: Check for files that contain merge conflict strings. +- `check-symlinks`: Checks for symlinks which do not point to anything. +- `check-yaml`: Attempts to load all yaml files to verify syntax. +- `check-json`: Attempts to load all json files to verify syntax. +- `check-toml`: Attempts to load all TOML files to verify syntax. +- `check-executables-have-shebangs`: Checks that non-binary executables have a proper shebang. +- `end-of-file-fixer`: Makes sure files end in a newline and only a newline. +- `mixed-line-ending`: Replaces or checks mixed line ending. +- `trailing-whitespace`: Trims trailing whitespace in markdown +- `clang-format`: Format C++ files using clang-format +- `cmake-format`: Format CMake files using cmake-format +- `yamllint`: Linter for yaml files +- `yamlfmt`: Format yaml files Please install pre-commit hooks before committing any code. @@ -276,13 +273,14 @@ pre-commit install -f --hook-type pre-commit ``` To manually check all files run: + ```bash pre-commit run --all-files ``` ## gitpod -To start right away without installing anything on your local machine, you can simply use the button in the Project State section at the top of this README. +To start right away without installing anything on your local machine, you can simply use the Open in Gitpod button in the Project State section at the top of this README. ## direnv & nix diff --git a/apps/cli/src/argument_parser.cpp b/apps/cli/src/argument_parser.cpp index 994ce8c..0def5b7 100644 --- a/apps/cli/src/argument_parser.cpp +++ b/apps/cli/src/argument_parser.cpp @@ -49,7 +49,7 @@ parse_commandline_arguments(lyra::args const& args) if (auto const result = command_line_parser.parse(args); !result) { - fmt::print(stderr, "Error in comman line: {}\n", result.message()); + fmt::print(stderr, "Error in commandline: {}\n", result.message()); fmt::print("{}\n", usage.str()); return EXIT_FAILURE; } diff --git a/apps/cli/tests/argument_parser_test.cpp b/apps/cli/tests/argument_parser_test.cpp index 605b388..44834ca 100644 --- a/apps/cli/tests/argument_parser_test.cpp +++ b/apps/cli/tests/argument_parser_test.cpp @@ -8,7 +8,7 @@ using namespace date; TEST_CASE("argument parser called with ", "[HTTPClient]") { - using SuccessfullParse = std::tuple, std::optional>; + using SuccessfulParse = std::tuple, std::optional>; SECTION("-h (help) exits with success") { @@ -32,8 +32,8 @@ TEST_CASE("argument parser called with ", "[HTTPClient]") const auto result = coronan_cli::parse_commandline_arguments({"program_name"}); - REQUIRE(std::holds_alternative(result)); - const auto& [country, start_date, end_date] = std::get(result); + REQUIRE(std::holds_alternative(result)); + const auto& [country, start_date, end_date] = std::get(result); REQUIRE(country == "CHE"); REQUIRE_FALSE(start_date.has_value()); REQUIRE_FALSE(end_date.has_value()); @@ -44,8 +44,8 @@ TEST_CASE("argument parser called with ", "[HTTPClient]") const auto result = coronan_cli::parse_commandline_arguments({"program_name", "-c", "CHN"}); - REQUIRE(std::holds_alternative(result)); - const auto& [country, start_date, end_date] = std::get(result); + REQUIRE(std::holds_alternative(result)); + const auto& [country, start_date, end_date] = std::get(result); REQUIRE(country == "CHN"); REQUIRE_FALSE(start_date.has_value()); REQUIRE_FALSE(end_date.has_value()); @@ -56,8 +56,8 @@ TEST_CASE("argument parser called with ", "[HTTPClient]") const auto result = coronan_cli::parse_commandline_arguments({"program_name", "--country", "CHN"}); - REQUIRE(std::holds_alternative(result)); - const auto& [country, start_date, end_date] = std::get(result); + REQUIRE(std::holds_alternative(result)); + const auto& [country, start_date, end_date] = std::get(result); REQUIRE(country == "CHN"); REQUIRE_FALSE(start_date.has_value()); REQUIRE_FALSE(end_date.has_value()); @@ -68,8 +68,8 @@ TEST_CASE("argument parser called with ", "[HTTPClient]") const auto result = coronan_cli::parse_commandline_arguments({"program_name", "-s", "2020-01-01"}); - REQUIRE(std::holds_alternative(result)); - const auto& [country, start_date, end_date] = std::get(result); + REQUIRE(std::holds_alternative(result)); + const auto& [country, start_date, end_date] = std::get(result); REQUIRE(country == "CHE"); REQUIRE(start_date.has_value()); REQUIRE(start_date == year_month_day{2020_y / January / 1_d}); @@ -81,8 +81,8 @@ TEST_CASE("argument parser called with ", "[HTTPClient]") const auto result = coronan_cli::parse_commandline_arguments({"program_name", "--start_date", "2020-01-01"}); - REQUIRE(std::holds_alternative(result)); - const auto& [country, start_date, end_date] = std::get(result); + REQUIRE(std::holds_alternative(result)); + const auto& [country, start_date, end_date] = std::get(result); REQUIRE(country == "CHE"); REQUIRE(start_date.has_value()); REQUIRE(start_date == year_month_day{2020_y / January / 1_d}); @@ -95,8 +95,8 @@ TEST_CASE("argument parser called with ", "[HTTPClient]") const auto result = coronan_cli::parse_commandline_arguments({"program_name", "--start_date", "2020-01-01", "-c", "CHN"}); - REQUIRE(std::holds_alternative(result)); - const auto& [country, start_date, end_date] = std::get(result); + REQUIRE(std::holds_alternative(result)); + const auto& [country, start_date, end_date] = std::get(result); REQUIRE(country == "CHN"); REQUIRE(start_date.has_value()); REQUIRE(start_date == year_month_day{2020_y / January / 1_d}); @@ -116,8 +116,8 @@ TEST_CASE("argument parser called with ", "[HTTPClient]") const auto result = coronan_cli::parse_commandline_arguments({"program_name", "-e", "2020-01-01"}); - REQUIRE(std::holds_alternative(result)); - const auto& [country, start_date, end_date] = std::get(result); + REQUIRE(std::holds_alternative(result)); + const auto& [country, start_date, end_date] = std::get(result); REQUIRE(country == "CHE"); REQUIRE(end_date.has_value()); REQUIRE(end_date == year_month_day{2020_y / January / 1_d}); @@ -129,8 +129,8 @@ TEST_CASE("argument parser called with ", "[HTTPClient]") const auto result = coronan_cli::parse_commandline_arguments({"program_name", "--end_date", "2020-01-01"}); - REQUIRE(std::holds_alternative(result)); - const auto& [country, start_date, end_date] = std::get(result); + REQUIRE(std::holds_alternative(result)); + const auto& [country, start_date, end_date] = std::get(result); REQUIRE(country == "CHE"); REQUIRE(end_date.has_value()); REQUIRE(end_date == year_month_day{2020_y / January / 1_d}); @@ -143,8 +143,8 @@ TEST_CASE("argument parser called with ", "[HTTPClient]") const auto result = coronan_cli::parse_commandline_arguments({"program_name", "--end_date", "2020-01-01", "-c", "CHN"}); - REQUIRE(std::holds_alternative(result)); - const auto& [country, start_date, end_date] = std::get(result); + REQUIRE(std::holds_alternative(result)); + const auto& [country, start_date, end_date] = std::get(result); REQUIRE(country == "CHN"); REQUIRE(end_date.has_value()); REQUIRE(end_date == year_month_day{2020_y / January / 1_d}); @@ -159,14 +159,14 @@ TEST_CASE("argument parser called with ", "[HTTPClient]") REQUIRE(std::get(result) == EXIT_FAILURE); } - SECTION("-passing all argumnets return country code, start date and end date") + SECTION("-passing all arguments return country code, start date and end date") { const auto result = coronan_cli::parse_commandline_arguments( {"program_name", "--start_date", "2019-01-01", "--end_date", "2020-01-01", "-c", "CHN"}); - REQUIRE(std::holds_alternative(result)); - const auto& [country, start_date, end_date] = std::get(result); + REQUIRE(std::holds_alternative(result)); + const auto& [country, start_date, end_date] = std::get(result); REQUIRE(country == "CHN"); REQUIRE(start_date.has_value()); REQUIRE(start_date == year_month_day{2019_y / January / 1_d}); diff --git a/apps/qt/CMakeLists.txt b/apps/qt/CMakeLists.txt index 423349e..bb3d422 100644 --- a/apps/qt/CMakeLists.txt +++ b/apps/qt/CMakeLists.txt @@ -47,7 +47,7 @@ set(HEADER_LIST "${CMAKE_CURRENT_SOURCE_DIR}/include/country_data_model.h" "${CMAKE_CURRENT_SOURCE_DIR}/include/country_chart_view.h" "${CMAKE_CURRENT_SOURCE_DIR}/include/mainwindow.h" ) -# AUTOMOC and AUTOUIC dows not work when Qt is built from source +# AUTOMOC and AUTOUIC does not work when Qt is built from source if(DOWNLOAD_QT6) qt6_wrap_ui(APP_UI_FILES ${CMAKE_CURRENT_LIST_DIR}/mainwindow.ui) qt6_wrap_cpp(MOC_FILES ${HEADER_LIST}) diff --git a/apps/qt/cmake/Qt.cmake b/apps/qt/cmake/Qt.cmake index 95075eb..3c47a76 100644 --- a/apps/qt/cmake/Qt.cmake +++ b/apps/qt/cmake/Qt.cmake @@ -27,7 +27,6 @@ set(QT_BUILD_EXAMPLES OFF) set(QT_BUILD_EXAMPLES_BY_DEFAULT OFF) set(QT_BUILD_TESTS OFF) set(QT_BUILD_DOCS OFF) - set(QT_MODULES Core Widgets Charts) set(CMAKE_CXX_STANDARD 20) diff --git a/apps/qt/country_data_model.cpp b/apps/qt/country_data_model.cpp index ba3bcb1..e60edc8 100644 --- a/apps/qt/country_data_model.cpp +++ b/apps/qt/country_data_model.cpp @@ -20,7 +20,7 @@ void CountryDataModel::populate_data(coronan::CountryData const& country_data) if (not country_data.timeline.empty()) { - // Unfortunatelly QDate(std::chrono::year_month_weekday_last date) can not be used when the compiler (libstdc++) + // Unfortunately QDate(std::chrono::year_month_weekday_last date) can not be used when the compiler (libstdc++) // does not fully support C++ 20 even for Qt >= 6.4 auto const start_qdate = QDate(static_cast(country_data.timeline.front().date.year()), static_cast(unsigned(country_data.timeline.front().date.month())), @@ -38,7 +38,7 @@ void CountryDataModel::populate_data(coronan::CountryData const& country_data) for (auto const& data_point : country_data.timeline) { CountryTimelineData timeline_data; - // Unfortunatelly QDate(std::chrono::year_month_weekday_last date) can not be used when the compiler (libstdc++) + // Unfortunately QDate(std::chrono::year_month_weekday_last date) can not be used when the compiler (libstdc++) // does not fully support C++ 20 even for Qt >= 6.4 auto const qdate = QDate(static_cast(data_point.date.year()), static_cast(unsigned(data_point.date.month())), diff --git a/apps/qt/main.cpp b/apps/qt/main.cpp index f6e858e..1dff4af 100644 --- a/apps/qt/main.cpp +++ b/apps/qt/main.cpp @@ -16,8 +16,8 @@ int main(int argc, char* argv[]) try { window.show(); - auto const titel = "Co[ro]nan " + std::string{coronan::config::project_version} + " by bbv Software Services AG"; - window.setWindowTitle(titel.c_str()); + auto const title = "Co[ro]nan " + std::string{coronan::config::project_version} + " by bbv Software Services AG"; + window.setWindowTitle(title.c_str()); auto const window_width = 1600; auto const window_height = 1200; window.resize(window_width, window_height); diff --git a/apps/qt/mainwindow.cpp b/apps/qt/mainwindow.cpp index b1e4895..5882515 100644 --- a/apps/qt/mainwindow.cpp +++ b/apps/qt/mainwindow.cpp @@ -60,7 +60,7 @@ void CoronanWidget::populate_date_boxes() { auto const latest_country_data = coronan::CoronaAPIClient{}.request_country_data(default_country_code, std::nullopt); auto const latest_date = latest_country_data.latest.date; - // Unfortunatelly QDate(std::chrono::year_month_weekday_last date) can not be used when the compiler (libstdc++) does + // Unfortunately QDate(std::chrono::year_month_weekday_last date) can not be used when the compiler (libstdc++) does // not fully support C++ 20 even for Qt >= 6.4 auto const latest_qdate = QDate(static_cast(latest_date.year()), // static_cast(unsigned(latest_date.month())), // diff --git a/build.sh b/build.sh index 8a0e380..0d4268d 100755 --- a/build.sh +++ b/build.sh @@ -15,9 +15,8 @@ LIBCXX="libstdc++11" CLEAR_BUILD=false CONAN=conan - print_usage() { -cat << EOM + cat </dev/null 2>&1 && pwd )" +SELF_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null 2>&1 && pwd)" -find "${SELF_DIR}" -name '*.h' -o -name '*.h' -o -name '*.cpp' | xargs clang-format -i -style=file -find "${SELF_DIR}" -name 'CMakeLists.txt' -o -name '*.cmake' | xargs cmake-format -i +find "${SELF_DIR}" \( -name '*.h' -o -name '*.cpp' \) -print0 | xargs -0 clang-format -i -style=file +find "${SELF_DIR}" \( -name 'CMakeLists.txt' -o -name '*.cmake' \) -print0 | xargs -0 cmake-format -i diff --git a/include/coronan/corona-api_datatypes.h b/include/coronan/corona-api_datatypes.h index f73e287..7ee36bd 100644 --- a/include/coronan/corona-api_datatypes.h +++ b/include/coronan/corona-api_datatypes.h @@ -63,7 +63,7 @@ struct CountryData * Holds the latest available covid-19 case data of the country */ - CovidData latest{}; /**< Lates actual cases */ + CovidData latest{}; /**< Latest actual cases */ std::vector timeline; /**< Timeline data (list of daily data) */ }; diff --git a/include/coronan/ssl_client.h b/include/coronan/ssl_client.h index 4cd15a3..d1fe9a1 100644 --- a/include/coronan/ssl_client.h +++ b/include/coronan/ssl_client.h @@ -18,8 +18,8 @@ class SSLClient final { public: /** - * Return a SSLClient with an accept all certifcates handler - * @return SSLClient which must be hold by the caler until no longer needed. + * Return a SSLClient with an accept all certificates handler + * @return SSLClient which must be hold by the caller until no longer needed. */ [[nodiscard]] static std::unique_ptr create_with_accept_certificate_handler(); diff --git a/tests/corona-api_json_parser_test.cpp b/tests/corona-api_json_parser_test.cpp index 29469e8..d60b216 100644 --- a/tests/corona-api_json_parser_test.cpp +++ b/tests/corona-api_json_parser_test.cpp @@ -32,7 +32,7 @@ TEST_CASE("The corona-api parser parsing an invalid json", "[corona-api parser]" } } -TEST_CASE("The corona-api parser parsing an region total json with invalide date", "[corona-api parser]") +TEST_CASE("The corona-api parser parsing an region total json with invalid date", "[corona-api parser]") { static constexpr auto test_json = "{ \ \"data\": { \ diff --git a/typos.toml b/typos.toml new file mode 100644 index 0000000..41c2887 --- /dev/null +++ b/typos.toml @@ -0,0 +1,7 @@ +[default] +locale = "en-us" +check-filename = true +check-file = true + +[default.extend-words] +THA = "THA" From ad1a0ef918ff1f91eaa64de856e2da0cb9167551 Mon Sep 17 00:00:00 2001 From: Michel Estermann Date: Thu, 12 Mar 2026 00:44:10 +0100 Subject: [PATCH 3/5] ci. fixed macOS package build --- .github/workflows/ci-macos.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/ci-macos.yml b/.github/workflows/ci-macos.yml index 03c7746..290f104 100644 --- a/.github/workflows/ci-macos.yml +++ b/.github/workflows/ci-macos.yml @@ -83,6 +83,8 @@ jobs: - name: CTest run: ctest -C Debug working-directory: ./build + - name: CMake build docs + run: cmake --build ./build --target doxygen-docs --config ${{ matrix.build_type }} - name: CMake build packages run: | cpack From 4f285d82a6aeb3b6758108e54af542ef9e4088f7 Mon Sep 17 00:00:00 2001 From: Michel Estermann Date: Fri, 13 Mar 2026 16:00:44 +0100 Subject: [PATCH 4/5] ci: fix appveyor package build --- appveyor.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/appveyor.yml b/appveyor.yml index 493e2ee..c76e4a2 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -27,6 +27,7 @@ before_build: build_script: - cmd: |- cmake --build --preset=visual-studio-release + cmake --build --preset=doc-windows cmake --build build --target package --config Release test_script: From c81c23203ac7831c82cea9bbee0391b5e5838a7b Mon Sep 17 00:00:00 2001 From: Michel Estermann Date: Fri, 13 Mar 2026 18:17:21 +0100 Subject: [PATCH 5/5] ci: removed unsupported macOs-13 --- .github/workflows/ci-macos.yml | 7 ------- 1 file changed, 7 deletions(-) diff --git a/.github/workflows/ci-macos.yml b/.github/workflows/ci-macos.yml index 290f104..f399a92 100644 --- a/.github/workflows/ci-macos.yml +++ b/.github/workflows/ci-macos.yml @@ -16,13 +16,6 @@ jobs: fail-fast: false matrix: include: - - name: macOS-13-clang - os: macOS-13 - build_type: Release - cppcompiler: clang++ - ccompiler: clang - libcxx: libc++ - generators: Ninja - name: macOS-15-intel-clang os: macos-15-intel build_type: Release