diff --git a/.clang-tidy b/.clang-tidy index 670bd92..41bc61e 100644 --- a/.clang-tidy +++ b/.clang-tidy @@ -1,5 +1,5 @@ --- -Checks: '*,-fuchsia-*,-google-*,-zircon-*,-abseil-*,-altera-*,-llvm*,-modernize-use-trailing-return-type,-misc-include-cleaner' +Checks: '*,-fuchsia-*,-google-*,-zircon-*,-abseil-*,-altera-*,-llvm*,-modernize-use-trailing-return-type,-misc-include-cleaner,-readability-else-after-return' WarningsAsErrors: '' HeaderFilterRegex: '' FormatStyle: none diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index d5eb1b0..0a09ad4 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -1,11 +1,14 @@ -FROM mcr.microsoft.com/devcontainers/base:dev-ubuntu24.04 -LABEL maintainer="Michel Estermann " +ARG BASE_IMAGE=mcr.microsoft.com/devcontainers/base:ubuntu + +FROM $BASE_IMAGE +LABEL maintainer="Michel Estermann " ARG CLANG_VERSION=18 ARG GCC_VERSION=14 RUN apt-get update \ + && apt-get clean \ && apt-get -qq install -y --no-install-recommends \ make \ build-essential \ @@ -25,6 +28,7 @@ RUN apt-get update \ gcc-14 \ file \ ssh-client \ + && apt-get clean \ && rm -rf /var/lib/apt/lists/* # Install locales package and generate en_US.UTF-8 locale @@ -132,3 +136,17 @@ RUN update-alternatives --install /usr/bin/cc cc /usr/bin/clang-${CLANG_VERSION} RUN update-alternatives --install /usr/bin/c++ c++ /usr/bin/clang++-${CLANG_VERSION} 100 RUN update-alternatives --install /usr/bin/clang-tidy clang-tidy /usr/bin/clang-tidy-${CLANG_VERSION} 100 RUN update-alternatives --install /usr/bin/clang-format clang-format /usr/bin/clang-format-${CLANG_VERSION} 100 + +# Install packages +RUN apt-get update \ + && apt-get -qq install -y --no-install-recommends \ + ubuntu-desktop \ + tightvncserver \ + novnc \ + websockify \ + && apt-get clean \ + && rm -rf /var/lib/apt/lists/* + +EXPOSE 5901 6080 + +CMD ["sh", "-c", "/usr/share/novnc/utils/launch.sh --vnc localhost:5901 & vncserver :1 -geometry 1400x1000 -depth 24 && tail -f /dev/null"] diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 88c4459..933ac77 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -1,40 +1,56 @@ { - "name": "C++", - "build": { + "name": "C++ noVNC", + "build": { "context": "..", - "dockerfile": "Dockerfile", - "args": { - "CLANG_VERSION": "18", - "GCC_VERSION": "14" - } - }, - "mounts": [ - "source=${localEnv:HOME}/.ssh,target=/home/vscode/.ssh,type=bind", - "source=${localEnv:HOME}/.conan2,target=/home/vscode/.conan2,type=bind", - "source=native-ccache,target=/opt/.native-ccache,type=volume" - ], + "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 && conan install . --build=missing --settings=build_type=Debug && conan install . --build=missing --settings=build_type=Release", - "customizations": { - "vscode": { - "extensions": [ - "ms-vscode.cpptools", - "ms-vscode.cpptools-extension-pack", - "xaver.clang-format", - "llvm-vs-code-extensions.vscode-clangd", - "twxs.cmake", - "ms-vscode.cmake-tools", - "mhutchie.git-graph", - "donjayamanne.githistory", - "webfreak.debug", - "jnoortheen.nix-ide", - "ms-python.python", - "hbenl.vscode-test-explorer", - "ms-azuretools.vscode-docker", - "codacy-app.codacy" - ] - } - } + "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" + } + } } diff --git a/.envrc b/.envrc index 22883b7..228bb02 100644 --- a/.envrc +++ b/.envrc @@ -1,5 +1,5 @@ # uncomment if you want to use a nix-shell to build # use nix -CC=gcc -CXX=g++ +export CC=gcc +export CXX=g++ diff --git a/.github/workflows/api-doc.yml b/.github/workflows/api-doc.yml index c0ab6d2..3366944 100644 --- a/.github/workflows/api-doc.yml +++ b/.github/workflows/api-doc.yml @@ -35,7 +35,7 @@ jobs: - name: Set conan compiler env run: conan profile detect - name: conan install - run: conan install . --build=missing --settings=build_type=Debug + run: conan install . --build=missing --settings build_type=Debug - name: cmake-configuration run: cmake -S . -B build -DCMAKE_BUILD_TYPE=Debug - name: build-documentation diff --git a/.github/workflows/ci-linux-sanatizer.yml b/.github/workflows/ci-linux-sanatizer.yml index a3d0365..2c068ec 100644 --- a/.github/workflows/ci-linux-sanatizer.yml +++ b/.github/workflows/ci-linux-sanatizer.yml @@ -156,7 +156,7 @@ jobs: - name: Set conan compiler env run: conan profile detect - name: conan install - run: conan install . --build=missing --settings=build_type=Debug --settings=compiler.cppstd=17 + run: conan install . --build=missing --settings build_type=Debug --settings=compiler.cppstd=17 - name: CMake configure run: | cmake -S . --preset=${{ matrix.profile }} diff --git a/.github/workflows/ci-linux.yml b/.github/workflows/ci-linux.yml index 2cb2e96..88368ca 100644 --- a/.github/workflows/ci-linux.yml +++ b/.github/workflows/ci-linux.yml @@ -79,12 +79,21 @@ jobs: generator: Ninja coverage: OFF download_qt: OFF - - name: ubuntu-24.04-clang-18-download-qt + - name: ubuntu-24.04-clang-19 os: ubuntu-24.04 build_type: Release - cppcompiler: clang++-18 - ccompiler: clang-18 - clang-tidy: clang-tidy-18 + cppcompiler: clang++-19 + ccompiler: clang-19 + clang-tidy: clang-tidy-19 + generator: Ninja + coverage: OFF + download_qt: OFF + - name: ubuntu-24.04-clang-19-download-qt + os: ubuntu-24.04 + build_type: Release + cppcompiler: clang++-19 + ccompiler: clang-19 + clang-tidy: clang-tidy-19 generator: Ninja coverage: OFF download_qt: ON @@ -124,6 +133,24 @@ jobs: generator: Ninja coverage: OFF download_qt: OFF + - name: ubuntu-24.04-arm-clang + os: ubuntu-24.04-arm + build_type: Release + cppcompiler: clang++ + ccompiler: clang + clang-tidy: clang-tidy + generator: Ninja + coverage: OFF + download_qt: OFF + - name: ubuntu-24.04-arm-gcc + os: ubuntu-24.04-arm + build_type: Release + cppcompiler: g++ + ccompiler: gcc + clang-tidy: clang-tidy + generator: Ninja + coverage: OFF + download_qt: OFF env: CXX: ${{ matrix.cppcompiler }} @@ -168,7 +195,7 @@ jobs: - name: Set conan compiler env run: conan profile detect - name: conan install - run: conan install . --build=missing --settings=build_type=${{ matrix.build_type }} --settings=compiler.cppstd=17 + run: conan install . --build=missing --settings build_type=${{ matrix.build_type }} --settings compiler.cppstd=17 - name: CMake configure run: | cmake -S . -B ./build -G "${{ matrix.generator }}" \ diff --git a/.github/workflows/ci-macos.yml b/.github/workflows/ci-macos.yml index 53c6ee2..03c7746 100644 --- a/.github/workflows/ci-macos.yml +++ b/.github/workflows/ci-macos.yml @@ -21,20 +21,29 @@ jobs: build_type: Release cppcompiler: clang++ ccompiler: clang + libcxx: libc++ + generators: Ninja + - name: macOS-15-intel-clang + os: macos-15-intel + build_type: Release + cppcompiler: clang++ + ccompiler: clang + libcxx: libc++ generators: Ninja - name: macOS-14-clang os: macOS-14 build_type: Release cppcompiler: clang++ ccompiler: clang + libcxx: libc++ generators: Ninja - name: macOS-15-clang os: macOS-15 build_type: Release cppcompiler: clang++ ccompiler: clang + libcxx: libc++ generators: Ninja - env: CXX: ${{ matrix.cppcompiler }} CC: ${{ matrix.ccompiler }} @@ -63,7 +72,7 @@ jobs: - name: Set conan compiler env run: conan profile detect - name: conan install - run: conan install . --build=missing --settings=build_type=${{ matrix.build_type }} + run: conan install . --build=missing --settings build_type=${{ matrix.build_type }} --settings compiler.libcxx=${{ matrix.libcxx }} - name: CMake configure run: | cmake -S . -B ./build -G "${{ matrix.generators }}" \ diff --git a/.github/workflows/ci-release.yml b/.github/workflows/ci-release.yml index a41a452..588d2a1 100644 --- a/.github/workflows/ci-release.yml +++ b/.github/workflows/ci-release.yml @@ -42,7 +42,7 @@ jobs: - name: Set conan compiler env run: conan profile detect - name: conan install - run: conan install . --build=missing --settings=build_type=Release --settings=compiler.cppstd=17 + run: conan install . --build=missing --settings build_type=Release --settings compiler.cppstd=17 - name: CMake configure run: | cmake -S . --preset=linux-gcc-release diff --git a/.github/workflows/ci-windows.yml b/.github/workflows/ci-windows.yml index b382c65..bb46403 100644 --- a/.github/workflows/ci-windows.yml +++ b/.github/workflows/ci-windows.yml @@ -22,13 +22,27 @@ jobs: cppcompiler: cl ccompiler: cl generators: Visual Studio 17 2022 + arch: x64 + qt-host: windows + qt-arch: win64_msvc2022_64 - name: windows-2025-VS-2022 os: windows-2025 build_type: Release cppcompiler: cl ccompiler: cl generators: Visual Studio 17 2022 - + arch: x64 + qt-host: windows + qt-arch: win64_msvc2022_64 + - name: windows-11-arm-VS-2022 + os: windows-11-arm + build_type: Release + cppcompiler: cl + ccompiler: cl + generators: Visual Studio 17 2022 + arch: arm64 + qt-host: windows_arm64 + qt-arch: win64_msvc2022_arm64 env: CXX: ${{ matrix.cppcompiler }} CC: ${{ matrix.ccompiler }} @@ -50,19 +64,25 @@ jobs: uses: jurplel/install-qt-action@v4 with: version: 6.8.3 - host: windows + host: ${{ matrix.qt-host }} target: desktop - arch: win64_msvc2022_64 + arch: ${{ matrix.qt-arch }} modules: qtcharts + - name: Install Qt ifw + uses: jurplel/install-qt-action@v4 + if: matrix.qt-host == 'windows' + with: + host: windows + target: desktop tools: tools_ifw - name: setup-msvc-dev uses: TheMrMilchmann/setup-msvc-dev@v3 with: - arch: x64 + arch: ${{ matrix.arch }} - name: Set conan compiler env run: conan profile detect - name: conan install - run: conan install . --build=missing --settings=build_type=${{ matrix.build_type }} --settings=compiler.cppstd=17 + run: conan install . --build=missing --settings build_type=${{ matrix.build_type }} --settings compiler.cppstd=17 - name: CMake configure run: | cmake -S . -B ./build -G "${{ matrix.generators }}" diff --git a/.github/workflows/nix.yml b/.github/workflows/nix.yml index 4a0e194..ff33343 100644 --- a/.github/workflows/nix.yml +++ b/.github/workflows/nix.yml @@ -41,13 +41,13 @@ jobs: ccache-${{ matrix.name }} - uses: cachix/install-nix-action@v27 with: - nix_path: nixpkgs=channel:nixos-24.11 + nix_path: nixpkgs=channel:nixos-25.05 - uses: cachix/cachix-action@v15 with: name: bbvch authToken: ${{ secrets.CACHIX_AUTH_TOKEN }} - run: | - nix-shell --command "conan profile detect" - nix-shell --command "conan install . --build=missing --settings=build_type=Debug" + nix-shell --command "source venv/bin/activate && conan profile detect" + nix-shell --command "source venv/bin/activate && conan install . --build=missing --settings build_type=Debug" nix-shell --command "cmake -S ${GITHUB_WORKSPACE} --preset=${{ matrix.configure_preset }}" nix-shell --command "cmake --build --preset=${{ matrix.build_preset }}" diff --git a/.github/workflows/sonarqube-scan.yml b/.github/workflows/sonarqube-scan.yml index a125252..cc0829c 100644 --- a/.github/workflows/sonarqube-scan.yml +++ b/.github/workflows/sonarqube-scan.yml @@ -59,17 +59,17 @@ jobs: - name: CMake configure run: cmake -S . -B ./build -G Ninja -DENABLE_COVERAGE=${{ env.WITH_COVERAGE }} -DCMAKE_BUILD_TYPE=${{ env.BUILD_TYPE }} - name: Run Build Wrapper - run: build-wrapper-linux-x86-64 --out-dir ${{ env.BUILD_WRAPPER_OUT_DIR }} cmake --build build/ --config ${{ env.BUILD_TYPE }} + run: build-wrapper-linux-x86-64 --out-dir ${{ env.BUILD_WRAPPER_OUT_DIR }} ninja -C ./build - name: Collect coverage into one XML report if: env.WITH_COVERAGE == 'ON' run: | gcovr --sonarqube > coverage.xml - name: SonarQube Scan - uses: SonarSource/sonarqube-scan-action@v4 + uses: sonarsource/sonarqube-scan-action@v6 env: SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} # Generate a token on SonarQube, add it to the secrets of this repo with the name SONAR_TOKEN (Settings > Secrets > Actions > add new repository secret) with: # Additional arguments for the sonarcloud scanner args: > - --define sonar.cfamily.compile-commands="${{ env.BUILD_WRAPPER_OUT_DIR }}/compile_commands.json" + --define sonar.cfamily.compile-commands=${{ env.BUILD_WRAPPER_OUT_DIR }}/compile_commands.json --define sonar.coverageReportPaths=coverage.xml diff --git a/.gitignore b/.gitignore index 0aa8af6..833f0d5 100644 --- a/.gitignore +++ b/.gitignore @@ -4,6 +4,5 @@ docs/conf.py CMakeFiles/* .cache/* CMakeUserPresets.json -include/coronan/config.hpp .github/workflows/ci-windows.yml .venv/ diff --git a/.gitpod.yml b/.gitpod.yml deleted file mode 100644 index 4fd2783..0000000 --- a/.gitpod.yml +++ /dev/null @@ -1,26 +0,0 @@ ---- -image: - file: .devcontainer/Dockerfile - -tasks: - - before: | - pre-commit install -f --hook-type pre-commit - rm -rf build - export CXX=clang++-18 - export CC=clang-18 - conan profile detect - init: conan install . --build=missing --settings=build_type=Debug - command: cmake -S . -B build --preset=linux-clang-debug - -vscode: - extensions: - - ms-vscode.cmake-tools - - github.vscode-pull-request-github - - jnoortheen.nix-ide - - webfreak.debug - - mhutchie.git-graph - - gruntfuggly.todo-tree - - vscode-icons-team.vscode-icons - - matepek.vscode-catch2-test-adapter - - xaver.clang-format - - streetsidesoftware.code-spell-checker diff --git a/.gitpod/automation.yml b/.gitpod/automation.yml new file mode 100644 index 0000000..d78c6e7 --- /dev/null +++ b/.gitpod/automation.yml @@ -0,0 +1,19 @@ +--- +tasks: + before-000: + command: | + pre-commit install -f --hook-type pre-commit + rm -rf build + export CXX=clang++-19 + export CC=clang-19 + conan profile detect + description: before task migrated from .gitpod.yml + name: 'Task 0: before' + init-000: + command: conan install . --build=missing --settings=build_type=Debug + dependsOn: + - before-000 + description: init task migrated from .gitpod.yml + name: 'Task 0: init' + triggeredBy: + - postDevcontainerStart diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 7c38055..64d532d 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,10 +1,9 @@ --- repos: - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v5.0.0 + rev: v6.0.0 hooks: - id: check-added-large-files - - id: check-byte-order-marker - id: check-case-conflict - id: check-merge-conflict - id: check-symlinks @@ -25,7 +24,7 @@ repos: hooks: - id: cmake-format - repo: https://github.com/adrienverge/yamllint.git - rev: v1.37.0 + rev: v1.37.1 hooks: - id: yamllint args: [--format, parsable, -d, relaxed] diff --git a/.vscode/tasks.json b/.vscode/tasks.json index 77e91bc..152d8ae 100644 --- a/.vscode/tasks.json +++ b/.vscode/tasks.json @@ -1,55 +1,135 @@ { "version": "2.0.0", "tasks": [ - { - "label": "build", - "command": "cmake --build build", - "group": { - "kind": "build", - "isDefault": true + { + "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 + } }, - "problemMatcher": { - "base": "$gcc" + { + "label": "build", + "command": "cmake --build build", + "group": { + "kind": "build", + "isDefault": true + }, + "problemMatcher": { + "base": "$gcc" + }, + "options": { + "cwd": "${workspaceFolder}/" + }, + "type": "shell", + "presentation": { + "clear": true + } }, - "options": { - "cwd": "${workspaceFolder}/" + { + "label": "clean", + "command": "/usr/bin/rm -rf build", + "group": "build", + "problemMatcher": [], + "type": "shell" }, - "type": "shell", - "presentation": { - "clear": true + { + "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" } - }, - { - "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" + ], + "inputs": [ + { + "id": "buildType", + "type": "pickString", + "description": "Choose an option", + "options": [ + "Debug", + "Release" + ] }, - "options": { - "cwd": "${workspaceFolder}" + { + "id": "compiler", + "type": "pickString", + "description": "Choose an option", + "options": [ + { + "label": "GCC", + "value": "gcc" + }, + { + "label": "Clang", + "value": "clang" + } + ] }, - "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" - } + { + "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" + } + ] + } ] - } +} diff --git a/CMakePresets.json b/CMakePresets.json index b7385da..3decfdd 100644 --- a/CMakePresets.json +++ b/CMakePresets.json @@ -119,8 +119,8 @@ }, { "name": "linux-gcc-release", - "displayName": "Release (gcc)", - "description": "Configure Release (gcc)", + "displayName": "Release (gnu)", + "description": "Configure Release (gnu)", "hidden": false, "inherits": [ "linux-gcc", diff --git a/README.md b/README.md index 06095da..0cf6e1b 100644 --- a/README.md +++ b/README.md @@ -26,12 +26,13 @@ [![codecov](https://codecov.io/gh/bbvch/Coronan/branch/master/graph/badge.svg)](https://codecov.io/gh/bbvch/Coronan) -[![SonarQube Cloud](https://sonarcloud.io/images/project_badges/sonarcloud-dark.svg)](https://sonarcloud.io/summary/new_code?id=bbvch_Coronan) +[![SonarQube Cloud](https://sonarcloud.io/images/project_badges/sonarcloud-dark.svg)](https://sonarcloud.io/summary/overall?id=bbvch_Coronann) -[![Bugs](https://sonarcloud.io/api/project_badges/measure?project=bbvch_Coronan&metric=bugs)](https://sonarcloud.io/summary/new_code?id=bbvch_Coronan) -[![Code Smells](https://sonarcloud.io/api/project_badges/measure?project=bbvch_Coronan&metric=code_smells)](https://sonarcloud.io/summary/new_code?id=bbvch_Coronan) -[![Coverage](https://sonarcloud.io/api/project_badges/measure?project=bbvch_Coronan&metric=coverage)](https://sonarcloud.io/summary/new_code?id=bbvch_Coronan) -[![Duplicated Lines (%)](https://sonarcloud.io/api/project_badges/measure?project=bbvch_Coronan&metric=duplicated_lines_density)](https://sonarcloud.io/summary/new_code?id=bbvch_Coronan) +[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=bbvch_Coronan&metric=alert_status)](https://sonarcloud.io/summary/overall?id=bbvch_Coronan) +[![Bugs](https://sonarcloud.io/api/project_badges/measure?project=bbvch_Coronan&metric=bugs)](https://sonarcloud.io/summary/overall?id=bbvch_Coronan) +[![Code Smells](https://sonarcloud.io/api/project_badges/measure?project=bbvch_Coronan&metric=code_smells)](https://sonarcloud.io/summary/overall?id=bbvch_Coronan) +[![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) @@ -200,7 +201,7 @@ You can also build it yourself using CMake and conan * __Install dependencies with conan__ ```bash - conan install . --build=missing --settings=build_type=Debug + 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`. @@ -285,7 +286,7 @@ To start right away without installing anything on your local machine, you can s ## direnv & nix -If you have [direnv](https://direnv.net/) and [nix](https://nixos.org/) installed everything should be setup to start upon entering the project folder, if `use nix` is not commented out in [.envrc](.envrc). gcc (gcc14) is set as default C and C++ compiler. If you prefer clang (clang_18) change it in [.envrc](.envrc) +If you have [direnv](https://direnv.net/) and [nix](https://nixos.org/) installed everything should be setup to start upon entering the project folder, if `use nix` is not commented out in [.envrc](.envrc). gcc (gcc14) is set as default C and C++ compiler. If you prefer clang (clang-19) change it in [.envrc](.envrc) You can also use `nix-shell` directly to build when `use nix` is disabled, e.g.: diff --git a/apps/cli/CMakeLists.txt b/apps/cli/CMakeLists.txt index 6554ddf..bd3fdfe 100644 --- a/apps/cli/CMakeLists.txt +++ b/apps/cli/CMakeLists.txt @@ -6,7 +6,7 @@ project( LANGUAGES CXX ) -set(HEADER_LIST "${CMAKE_CURRENT_LIST_DIR}/src/argument_parser.hpp") +set(HEADER_LIST "${CMAKE_CURRENT_LIST_DIR}/src/argument_parser.h") add_library(cli_arg_parser STATIC ${CMAKE_CURRENT_LIST_DIR}/src/argument_parser.cpp ${HEADER_LIST}) diff --git a/apps/cli/src/argument_parser.cpp b/apps/cli/src/argument_parser.cpp index 5e96674..994ce8c 100644 --- a/apps/cli/src/argument_parser.cpp +++ b/apps/cli/src/argument_parser.cpp @@ -1,4 +1,4 @@ -#include "argument_parser.hpp" +#include "argument_parser.h" #include #include diff --git a/apps/cli/src/argument_parser.hpp b/apps/cli/src/argument_parser.h similarity index 100% rename from apps/cli/src/argument_parser.hpp rename to apps/cli/src/argument_parser.h diff --git a/apps/cli/src/main.cpp b/apps/cli/src/main.cpp index c3d92a4..47a8661 100644 --- a/apps/cli/src/main.cpp +++ b/apps/cli/src/main.cpp @@ -1,8 +1,8 @@ -#include "argument_parser.hpp" -#include "coronan/corona-api_client.hpp" -#include "coronan/corona-api_datatypes.hpp" -#include "coronan/http_client.hpp" -#include "coronan/ssl_client.hpp" +#include "argument_parser.h" +#include "coronan/corona-api_client.h" +#include "coronan/corona-api_datatypes.h" +#include "coronan/http_client.h" +#include "coronan/ssl_client.h" #include #include diff --git a/apps/cli/tests/argument_parser_test.cpp b/apps/cli/tests/argument_parser_test.cpp index 4678de7..605b388 100644 --- a/apps/cli/tests/argument_parser_test.cpp +++ b/apps/cli/tests/argument_parser_test.cpp @@ -1,4 +1,4 @@ -#include "argument_parser.hpp" +#include "argument_parser.h" #include #include diff --git a/apps/qt/CMakeLists.txt b/apps/qt/CMakeLists.txt index ee84952..423349e 100644 --- a/apps/qt/CMakeLists.txt +++ b/apps/qt/CMakeLists.txt @@ -43,9 +43,9 @@ set(CMAKE_INSTALL_RPATH $ORIGIN $ORIGIN/${relDir}) message(STATUS "CMAKE_LIBRARY_PATH ${CMAKE_LIBRARY_PATH}") set(HEADER_LIST - "${CMAKE_CURRENT_SOURCE_DIR}/include/country_overview_table_model.hpp" - "${CMAKE_CURRENT_SOURCE_DIR}/include/country_data_model.hpp" - "${CMAKE_CURRENT_SOURCE_DIR}/include/country_chart_view.hpp" "${CMAKE_CURRENT_SOURCE_DIR}/include/mainwindow.h" + "${CMAKE_CURRENT_SOURCE_DIR}/include/country_overview_table_model.h" + "${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 if(DOWNLOAD_QT6) @@ -80,6 +80,7 @@ target_link_libraries( PRIVATE coronan::library PRIVATE coronan::compile_warnings PRIVATE coronan::compile_options + PRIVATE coronan::version ) # include(StaticAnalyzers) enable_static_analysis(${PROJECT_NAME}) diff --git a/apps/qt/cmake/Qt.cmake b/apps/qt/cmake/Qt.cmake index 0688d90..95075eb 100644 --- a/apps/qt/cmake/Qt.cmake +++ b/apps/qt/cmake/Qt.cmake @@ -37,7 +37,7 @@ FetchContent_Declare( GIT_TAG "${QT_VERSION}" GIT_SHALLOW TRUE GIT_PROGRESS TRUE - GIT_SUBMODULES ${QT_BUILD_SUBMODULES} + GIT_SUBMODULES ${QT_BUILD_SUBMODULES} SYSTEM ) FetchContent_MakeAvailable(qt6) diff --git a/apps/qt/country_chart_view.cpp b/apps/qt/country_chart_view.cpp index 249dc57..cfd1491 100644 --- a/apps/qt/country_chart_view.cpp +++ b/apps/qt/country_chart_view.cpp @@ -1,6 +1,6 @@ -#include "country_chart_view.hpp" +#include "country_chart_view.h" -#include "country_data_model.hpp" +#include "country_data_model.h" #include #include diff --git a/apps/qt/country_data_model.cpp b/apps/qt/country_data_model.cpp index 74c7ab1..ba3bcb1 100644 --- a/apps/qt/country_data_model.cpp +++ b/apps/qt/country_data_model.cpp @@ -1,4 +1,4 @@ -#include "country_data_model.hpp" +#include "country_data_model.h" namespace { inline constexpr auto columns = 5u; @@ -20,18 +20,14 @@ 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++) -// does not fully support C++ 20 even for Qt >= 6.4 -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wsign-conversion" + // Unfortunatelly 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(country_data.timeline.front().date.month()), - static_cast(country_data.timeline.front().date.day())); + static_cast(unsigned(country_data.timeline.front().date.month())), + static_cast(unsigned(country_data.timeline.front().date.day()))); auto const end_qdate = QDate(static_cast(country_data.timeline.back().date.year()), - static_cast(static_cast(country_data.timeline.back().date.month())), - static_cast(static_cast(country_data.timeline.back().date.day()))); - -#pragma GCC diagnostic pop + static_cast(unsigned(country_data.timeline.back().date.month())), + static_cast(unsigned(country_data.timeline.back().date.day()))); start_date = QDateTime{start_qdate, QTime(1, 0)}; end_date = QDateTime{end_qdate, QTime(1, 0)}; @@ -44,9 +40,9 @@ void CountryDataModel::populate_data(coronan::CountryData const& country_data) CountryTimelineData timeline_data; // Unfortunatelly 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(static_cast(data_point.date.month())), - static_cast(static_cast(data_point.date.day()))); + auto const qdate = + QDate(static_cast(data_point.date.year()), static_cast(unsigned(data_point.date.month())), + static_cast(unsigned(data_point.date.day()))); timeline_data.date = QDateTime{qdate, QTime(1, 0)}; timeline_data.deaths = data_point.deaths.has_value() ? QVariant{data_point.deaths.value()} : QVariant{}; min = std::min(min, data_point.deaths.value_or(min)); diff --git a/apps/qt/country_overview_table_model.cpp b/apps/qt/country_overview_table_model.cpp index ae9fb11..4f1c2be 100644 --- a/apps/qt/country_overview_table_model.cpp +++ b/apps/qt/country_overview_table_model.cpp @@ -1,4 +1,4 @@ -#include "country_overview_table_model.hpp" +#include "country_overview_table_model.h" #include #include diff --git a/apps/qt/include/country_chart_view.hpp b/apps/qt/include/country_chart_view.h similarity index 100% rename from apps/qt/include/country_chart_view.hpp rename to apps/qt/include/country_chart_view.h diff --git a/apps/qt/include/country_data_model.hpp b/apps/qt/include/country_data_model.h similarity index 97% rename from apps/qt/include/country_data_model.hpp rename to apps/qt/include/country_data_model.h index 627080c..ec0f794 100644 --- a/apps/qt/include/country_data_model.hpp +++ b/apps/qt/include/country_data_model.h @@ -1,6 +1,6 @@ #pragma once -#include "coronan/corona-api_datatypes.hpp" +#include "coronan/corona-api_datatypes.h" #include #include diff --git a/apps/qt/include/country_overview_table_model.hpp b/apps/qt/include/country_overview_table_model.h similarity index 96% rename from apps/qt/include/country_overview_table_model.hpp rename to apps/qt/include/country_overview_table_model.h index 8067608..408fcf7 100644 --- a/apps/qt/include/country_overview_table_model.hpp +++ b/apps/qt/include/country_overview_table_model.h @@ -1,6 +1,6 @@ #pragma once -#include "coronan/corona-api_datatypes.hpp" +#include "coronan/corona-api_datatypes.h" #include #include diff --git a/apps/qt/include/mainwindow.h b/apps/qt/include/mainwindow.h index 980b8e2..94909ac 100644 --- a/apps/qt/include/mainwindow.h +++ b/apps/qt/include/mainwindow.h @@ -1,7 +1,7 @@ #pragma once -#include "coronan/corona-api_datatypes.hpp" -#include "country_data_model.hpp" -#include "country_overview_table_model.hpp" +#include "coronan/corona-api_datatypes.h" +#include "country_data_model.h" +#include "country_overview_table_model.h" #include #include diff --git a/apps/qt/main.cpp b/apps/qt/main.cpp index b6fce9a..f6e858e 100644 --- a/apps/qt/main.cpp +++ b/apps/qt/main.cpp @@ -1,6 +1,6 @@ -#include "coronan/config.hpp" -#include "coronan/http_client.hpp" -#include "coronan/ssl_client.hpp" +#include "coronan/http_client.h" +#include "coronan/ssl_client.h" +#include "coronan/version.h" #include "mainwindow.h" #include diff --git a/apps/qt/mainwindow.cpp b/apps/qt/mainwindow.cpp index e04701d..b1e4895 100644 --- a/apps/qt/mainwindow.cpp +++ b/apps/qt/mainwindow.cpp @@ -1,7 +1,7 @@ #include "mainwindow.h" -#include "coronan/corona-api_client.hpp" -#include "country_chart_view.hpp" +#include "coronan/corona-api_client.h" +#include "country_chart_view.h" #include "ui_mainwindow.h" #include @@ -62,9 +62,9 @@ void CoronanWidget::populate_date_boxes() 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 // not fully support C++ 20 even for Qt >= 6.4 - auto const latest_qdate = QDate(static_cast(latest_date.year()), // - static_cast(latest_date.month()), // - static_cast(latest_date.day())); + auto const latest_qdate = QDate(static_cast(latest_date.year()), // + static_cast(unsigned(latest_date.month())), // + static_cast(unsigned(latest_date.day()))); ui->startDate->setDate(default_start_date); ui->startDate->setMaximumDate(latest_qdate); diff --git a/appveyor.yml b/appveyor.yml index d1d00dc..493e2ee 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -10,12 +10,11 @@ cache: environment: PYTHON: c:\Python39-x64\python.exe - Qt6_DIR: c:\Qt\6.8.1\msvc2022_64 + Qt6_DIR: c:\Qt\6.9.3\msvc2022_64 install: - cmd: |- choco install doxygen.install - choco install qt6-base-dev set PATH=%PATH%;C:\Users\appveyor\AppData\Roaming\Python\Python39\Scripts "%PYTHON%" -m pip install --user -r %APPVEYOR_BUILD_FOLDER%\py-requirements.txt conan profile detect diff --git a/build.sh b/build.sh index a051393..8a0e380 100755 --- a/build.sh +++ b/build.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash set -e @@ -11,6 +11,7 @@ BUILD_TARGET="--target all" CXX_COMPILER="g++" C_COMPILER="gcc" COMPILER_VERSION="$(g++ -dumpversion)" +LIBCXX="libstdc++11" CLEAR_BUILD=false CONAN=conan @@ -112,7 +113,7 @@ if [[ "${CLEAR_BUILD}" = true ]] ; then fi echo "run conan install" -"${CONAN}" install . --build=missing --settings=build_type="${BUILD_TYPE}" --settings=compiler="${C_COMPILER}" --settings=compiler.version="${COMPILER_VERSION}" --settings=compiler.cppstd=17 +"${CONAN}" install . --build=missing --settings build_type="${BUILD_TYPE}" --settings compiler="${C_COMPILER}" --settings compiler.version="${COMPILER_VERSION}" --settings compiler.libcxx="${LIBCXX}" --settings compiler.cppstd=17 if [[ "${COVERAGE}" = true ]] ; then "${CMAKE}" -S . -B "${BUILD_DIR}" "${CMAKE_GENERATOR}" -DENABLE_COVERAGE=ON -DCMAKE_BUILD_TYPE=Debug diff --git a/cmake/CompilerWarnings.cmake b/cmake/CompilerWarnings.cmake index 7e7d705..3c6b3f2 100644 --- a/cmake/CompilerWarnings.cmake +++ b/cmake/CompilerWarnings.cmake @@ -1,5 +1,5 @@ function(set_project_warnings project_name) - option(WARNINGS_AS_ERRORS "Treat compiler warnings as errors" OFF) + option(WARNINGS_AS_ERRORS "Treat compiler warnings as errors" ON) set(MSVC_WARNINGS /W4 # Baseline reasonable warnings @@ -38,7 +38,6 @@ function(set_project_warnings project_name) ) set(CLANG_WARNINGS - -march=native -Wall -Wextra # reasonable and standard -Wshadow # warn the user if a variable declaration shadows one from a diff --git a/cmake/StaticAnalyzers.cmake b/cmake/StaticAnalyzers.cmake index 3a591cd..93c8968 100644 --- a/cmake/StaticAnalyzers.cmake +++ b/cmake/StaticAnalyzers.cmake @@ -23,8 +23,17 @@ endif() function(enable_static_analysis project_name) if(ENABLE_CPPCHECK) - set(CPPCHECK_PROPERTIES "${CPPCHECK}" "--suppress=missingInclude" "--enable=all" "--std=c++17" "--inline-suppr" - "--inconclusive" + set(CPPCHECK_PROPERTIES + "${CPPCHECK}" + "--enable=all" + "--disable=unusedFunction" + "--suppress=functionStatic" + "--suppress=missingIncludeSystem" + "--suppress=checkersReport" + "--std=c++17" + "--inline-suppr" + "--inconclusive" + "--check-level=exhaustive" ) set_target_properties(${project_name} PROPERTIES CXX_CPPCHECK "${CPPCHECK_PROPERTIES}") message(STATUS "cppcheck static analysis enabled for ${project_name} (cppcheck: ${CPPCHECK})") diff --git a/conanfile.py b/conanfile.py new file mode 100644 index 0000000..400024d --- /dev/null +++ b/conanfile.py @@ -0,0 +1,32 @@ +from conan import ConanFile +from conan.tools.cmake import cmake_layout + + +class CoronanRecipe(ConanFile): + settings = 'os', 'compiler', 'build_type', 'arch' + generators = 'CMakeDeps' + + def configure(self): + self.options['poco'].enable_data = False + self.options['poco'].enable_data_postgresql = False + self.options['poco'].enable_data_mysql = False + self.options['poco'].enable_data_sqlite = False + self.options['poco'].enable_data_odbc = False + self.options['poco'].enable_mongodb = False + self.options['poco'].enable_redis = False + self.options['poco'].enable_jwt = False + self.options['poco'].enable_zip = False + self.options['poco'].enable_activerecord = False + + + def requirements(self): + self.requires('poco/1.14.2') + self.requires('rapidjson/cci.20230929') + self.requires('lyra/1.7.0') + self.requires('catch2/3.11.0') + self.requires('fmt/12.1.0') + self.requires('date/3.0.4') + + + def layout(self): + cmake_layout(self) diff --git a/conanfile.txt b/conanfile.txt deleted file mode 100644 index e63af10..0000000 --- a/conanfile.txt +++ /dev/null @@ -1,25 +0,0 @@ -[requires] -poco/1.13.3 -rapidjson/cci.20230929 -lyra/1.6.1 -catch2/3.8.0 -fmt/11.1.1 -date/3.0.3 - -[generators] -CMakeDeps - -[options] -poco/*:enable_data = False -poco/*:enable_data_postgresql = False -poco/*:enable_data_mysql = False -poco/*:enable_data_sqlite = False -poco/*:enable_data_odbc = False -poco/*:enable_mongodb = False -poco/*:enable_redis = False -poco/*:enable_jwt = False -poco/*:enable_zip = False -poco/*:enable_activerecord = False - -[layout] -cmake_layout diff --git a/configured_files/CMakeLists.txt b/configured_files/CMakeLists.txt index f1c029b..017a9e6 100644 --- a/configured_files/CMakeLists.txt +++ b/configured_files/CMakeLists.txt @@ -1 +1,7 @@ -configure_file("config.hpp.in" "${CMAKE_CURRENT_LIST_DIR}/../include/coronan/config.hpp" ESCAPE_QUOTES) +configure_file("version.h.in" "${CMAKE_CURRENT_BINARY_DIR}/generated/coronan/version.h" ESCAPE_QUOTES) + +add_library(coronan-version INTERFACE) + +add_library(coronan::version ALIAS coronan-version) + +target_include_directories(coronan-version INTERFACE ${CMAKE_CURRENT_BINARY_DIR}/generated) diff --git a/configured_files/config.hpp.in b/configured_files/version.h.in similarity index 90% rename from configured_files/config.hpp.in rename to configured_files/version.h.in index e76dd88..ad0a52b 100644 --- a/configured_files/config.hpp.in +++ b/configured_files/version.h.in @@ -1,5 +1,8 @@ #pragma once +// Generated by CMake. Do not edit. +#pragma once + // Generated by CMake. Do not edit. #include diff --git a/coronan.code-workspace b/coronan.code-workspace index 77f1f7b..1247e55 100644 --- a/coronan.code-workspace +++ b/coronan.code-workspace @@ -37,7 +37,7 @@ "[cpp]": { "editor.defaultFormatter": "xaver.clang-format" }, - "editor.formatOnSave": true, + "editor.formatOnSave": false, "editor.inlayHints.enabled": "offUnlessPressed", "editor.quickSuggestions": { "other": true, diff --git a/default.nix b/default.nix index 80c53ac..caff26c 100644 --- a/default.nix +++ b/default.nix @@ -1 +1 @@ -import shell.nix +import nix/shell.nix diff --git a/format_source_files.sh b/format_source_files.sh index c5ea518..aee14ce 100755 --- a/format_source_files.sh +++ b/format_source_files.sh @@ -1,8 +1,8 @@ -#!/bin/bash +#!/usr/bin/env bash set -e SELF_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" -find "${SELF_DIR}" -name '*.hpp' -o -name '*.h' -o -name '*.cpp' | xargs clang-format -i -style=file +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 diff --git a/include/coronan/corona-api_client.hpp b/include/coronan/corona-api_client.h similarity index 98% rename from include/coronan/corona-api_client.hpp rename to include/coronan/corona-api_client.h index fe23d6f..a302046 100644 --- a/include/coronan/corona-api_client.hpp +++ b/include/coronan/corona-api_client.h @@ -1,8 +1,8 @@ #pragma once -#include "coronan/corona-api_parser.hpp" -#include "coronan/http_client.hpp" -#include "coronan/ssl_client.hpp" +#include "coronan/corona-api_parser.h" +#include "coronan/http_client.h" +#include "coronan/ssl_client.h" #include #include diff --git a/include/coronan/corona-api_datatypes.hpp b/include/coronan/corona-api_datatypes.h similarity index 100% rename from include/coronan/corona-api_datatypes.hpp rename to include/coronan/corona-api_datatypes.h diff --git a/include/coronan/corona-api_parser.hpp b/include/coronan/corona-api_parser.h similarity index 97% rename from include/coronan/corona-api_parser.hpp rename to include/coronan/corona-api_parser.h index ff81e56..136294d 100644 --- a/include/coronan/corona-api_parser.hpp +++ b/include/coronan/corona-api_parser.h @@ -1,6 +1,6 @@ #pragma once -#include "coronan/corona-api_datatypes.hpp" +#include "coronan/corona-api_datatypes.h" #include #include diff --git a/include/coronan/http_client.hpp b/include/coronan/http_client.h similarity index 100% rename from include/coronan/http_client.hpp rename to include/coronan/http_client.h diff --git a/include/coronan/ssl_client.hpp b/include/coronan/ssl_client.h similarity index 100% rename from include/coronan/ssl_client.hpp rename to include/coronan/ssl_client.h diff --git a/include/coronan/ssl_context.hpp b/include/coronan/ssl_context.h similarity index 100% rename from include/coronan/ssl_context.hpp rename to include/coronan/ssl_context.h diff --git a/install-qt.sh b/install-qt.sh index c6f8b52..997be36 100755 --- a/install-qt.sh +++ b/install-qt.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash set -e diff --git a/cmake.nix b/nix/cmake.nix similarity index 100% rename from cmake.nix rename to nix/cmake.nix diff --git a/nix-lock.toml b/nix/nix-lock.toml similarity index 60% rename from nix-lock.toml rename to nix/nix-lock.toml index bcd5d2f..f2d0a82 100644 --- a/nix-lock.toml +++ b/nix/nix-lock.toml @@ -4,6 +4,6 @@ rev = "63dacb46bf939521bdc93981b4cbb7ecb58427a0" sha256 = "1lr1h35prqkd1mkmzriwlpvxcb34kmhc9dnr48gkm8hh089hifmx" [cmake] -ref = "3.31.4" -rev = "3.31.4" -sha256 = "09bz1y5jr4n2ln9q6zlm44ar78f0yxcl7qvjwrrmrfpmfpz0n4x6" +ref = "3.31.10" +rev = "3.31.10" +sha256 = "0a9y7nqr27rl8acvjyj8s57q87bdjxa9w2g5mphsh7ylsvgzl1ng" diff --git a/shell.nix b/nix/shell.nix similarity index 85% rename from shell.nix rename to nix/shell.nix index 06d3275..73bb969 100644 --- a/shell.nix +++ b/nix/shell.nix @@ -5,10 +5,6 @@ let clang = clang_18; cmake_331 = (import ./cmake.nix).cmake; - gcovr = python3.withPackages(ps: [ - ps.gcovr - ]); - in stdenvNoCC.mkDerivation { name = "shell"; hardeningDisable = [ "all" ]; @@ -31,7 +27,6 @@ in stdenvNoCC.mkDerivation { qt6.qtbase qt6.qtcharts lcov - gcovr perl doxygen graphviz @@ -39,6 +34,7 @@ in stdenvNoCC.mkDerivation { pre-commit python3 cmake-format + gcovr python3Packages.setuptools python3Packages.pip python3Packages.virtualenv @@ -47,7 +43,7 @@ in stdenvNoCC.mkDerivation { shellHook = '' pre-commit install -f --hook-type pre-commit virtualenv venv - source venv/bin/activate - python3 -m pip install -r py-requirements.txt + venv/bin/python3 -m pip install conan + venv/bin/python3 -m pip install python-dateutil ''; } diff --git a/sources.nix b/nix/sources.nix similarity index 100% rename from sources.nix rename to nix/sources.nix diff --git a/py-requirements.txt b/py-requirements.txt index a658d59..fed16f0 100644 --- a/py-requirements.txt +++ b/py-requirements.txt @@ -1,10 +1,10 @@ cmake>=3.31,<4.0 -conan>=2.15 -gcovr>=8.2 -pre-commit>=4.0.1 -cmake-format>=0.6.13 -setuptools>=75.0.0 -python-dateutil==2.9.0 -requests>=2.32.2 # not directly required, pinned by Snyk to avoid a vulnerability -zipp>=3.19.1 # not directly required, pinned by Snyk to avoid a vulnerability -urllib3>=1.26.19 # not directly required, pinned by Snyk to avoid a vulnerability +conan~=2.22.0 +gcovr~=8.0 +pre-commit>=4.0.0, <5.0.0 +cmake-format~=0.6.0 +setuptools~=75.0.0 +python-dateutil>=2.8.0, <3.0 +requests~=2.32.2 # not directly required, pinned by Snyk to avoid a vulnerability +zipp~=3.19.1 # not directly required, pinned by Snyk to avoid a vulnerability +urllib3~=1.26.19 # not directly required, pinned by Snyk to avoid a vulnerability diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index b942033..cd98165 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -7,12 +7,12 @@ project( ) set(HEADER_LIST - "${CMAKE_CURRENT_SOURCE_DIR}/../include/coronan/http_client.hpp" - "${CMAKE_CURRENT_SOURCE_DIR}/../include/coronan/corona-api_datatypes.hpp" - "${CMAKE_CURRENT_SOURCE_DIR}/../include/coronan/corona-api_parser.hpp" - "${CMAKE_CURRENT_SOURCE_DIR}/../include/coronan/corona-api_client.hpp" - "${CMAKE_CURRENT_SOURCE_DIR}/../include/coronan/ssl_client.hpp" - "${CMAKE_CURRENT_SOURCE_DIR}/../include/coronan/ssl_context.hpp" + "${CMAKE_CURRENT_SOURCE_DIR}/../include/coronan/http_client.h" + "${CMAKE_CURRENT_SOURCE_DIR}/../include/coronan/corona-api_datatypes.h" + "${CMAKE_CURRENT_SOURCE_DIR}/../include/coronan/corona-api_parser.h" + "${CMAKE_CURRENT_SOURCE_DIR}/../include/coronan/corona-api_client.h" + "${CMAKE_CURRENT_SOURCE_DIR}/../include/coronan/ssl_client.h" + "${CMAKE_CURRENT_SOURCE_DIR}/../include/coronan/ssl_context.h" ) add_library(coronan STATIC ${HEADER_LIST}) diff --git a/src/corona-api_parser.cpp b/src/corona-api_parser.cpp index 720a2f6..36f32c7 100644 --- a/src/corona-api_parser.cpp +++ b/src/corona-api_parser.cpp @@ -1,4 +1,4 @@ -#include "coronan/corona-api_parser.hpp" +#include "coronan/corona-api_parser.h" #include #include diff --git a/src/http_client.cpp b/src/http_client.cpp index b77e0bd..15b68a1 100644 --- a/src/http_client.cpp +++ b/src/http_client.cpp @@ -1,4 +1,4 @@ -#include "coronan/http_client.hpp" +#include "coronan/http_client.h" #include namespace coronan { diff --git a/src/ssl_client.cpp b/src/ssl_client.cpp index eb82d08..45f1ed3 100644 --- a/src/ssl_client.cpp +++ b/src/ssl_client.cpp @@ -1,7 +1,7 @@ -#include "coronan/ssl_client.hpp" +#include "coronan/ssl_client.h" -#include "coronan/ssl_context.hpp" +#include "coronan/ssl_context.h" #include #include diff --git a/src/ssl_context-linux.cpp b/src/ssl_context-linux.cpp index 7a6dd06..a7462b0 100644 --- a/src/ssl_context-linux.cpp +++ b/src/ssl_context-linux.cpp @@ -1,4 +1,4 @@ -#include "coronan/ssl_context.hpp" +#include "coronan/ssl_context.h" #include diff --git a/src/ssl_context-win.cpp b/src/ssl_context-win.cpp index ff12def..b11ae96 100644 --- a/src/ssl_context-win.cpp +++ b/src/ssl_context-win.cpp @@ -1,4 +1,4 @@ -#include "coronan/ssl_context.hpp" +#include "coronan/ssl_context.h" namespace coronan::ssl_context { diff --git a/tests/corona-api_client_test.cpp b/tests/corona-api_client_test.cpp index 456ec93..178edfc 100644 --- a/tests/corona-api_client_test.cpp +++ b/tests/corona-api_client_test.cpp @@ -1,4 +1,4 @@ -#include "coronan/corona-api_client.hpp" +#include "coronan/corona-api_client.h" #include #include diff --git a/tests/corona-api_json_parser_test.cpp b/tests/corona-api_json_parser_test.cpp index 2c15d58..29469e8 100644 --- a/tests/corona-api_json_parser_test.cpp +++ b/tests/corona-api_json_parser_test.cpp @@ -1,4 +1,4 @@ -#include "coronan/corona-api_parser.hpp" +#include "coronan/corona-api_parser.h" #include diff --git a/tests/http_client_test.cpp b/tests/http_client_test.cpp index e7cf63f..da57b45 100644 --- a/tests/http_client_test.cpp +++ b/tests/http_client_test.cpp @@ -1,4 +1,4 @@ -#include "coronan/http_client.hpp" +#include "coronan/http_client.h" #include #include