From d2c2a79bb0daa6d722ae3c2374f3cf04d543a6b1 Mon Sep 17 00:00:00 2001 From: Felix Oesterle Date: Tue, 3 Jun 2025 20:25:42 +0200 Subject: [PATCH 1/3] **sys(config): add Qlty configuration and GitHub Actions workflow** - Introduced `.qlty/qlty.toml` for Qlty CLI and Cloud integration. - Added `TestWithSinglePython.yml` for testing and linting using Python 3.12. --- .github/workflows/TestWithSinglePython.yml | 53 +++++++ .qlty/qlty.toml | 163 +++++++++++++++++++++ 2 files changed, 216 insertions(+) create mode 100644 .github/workflows/TestWithSinglePython.yml create mode 100644 .qlty/qlty.toml diff --git a/.github/workflows/TestWithSinglePython.yml b/.github/workflows/TestWithSinglePython.yml new file mode 100644 index 0000000..5445f27 --- /dev/null +++ b/.github/workflows/TestWithSinglePython.yml @@ -0,0 +1,53 @@ +# This workflow will install Python dependencies, run tests and lint with a single version of Python +# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions + +name: Test single python version + +on: + push: + branches: [ master ] + paths-ignore: + - 'docs/**' + pull_request: + branches: [ master ] + paths-ignore: + - 'docs/**' + workflow_dispatch: + +jobs: + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: '3.12' + check-latest: true + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install flake8 pytest pytest-cov + pip install numpy cython + pip install setuptools + pip install pytest_mock + - name: Compile cython code + run: | + python setup.py build_ext --inplace --define CYTHON_TRACE + - name: Install avaframe + run: | + pip install avaframe + - name: Install debrisframe + run: | + pip install . + - name: Test with pytest + run: | + pytest -ra --cov --cov-report=xml --cov-report lcov:cov.info --cov-config=.coveragerc + - uses: qltysh/qlty-action/coverage@v1 + with: + token: ${{secrets.QLTY_COVERAGE_TOKEN}} + files: cov.info diff --git a/.qlty/qlty.toml b/.qlty/qlty.toml new file mode 100644 index 0000000..a08286a --- /dev/null +++ b/.qlty/qlty.toml @@ -0,0 +1,163 @@ +# This file was automatically generated by `qlty init`. +# You can modify it to suit your needs. +# We recommend you to commit this file to your repository. +# +# This configuration is used by both Qlty CLI and Qlty Cloud. +# +# Qlty CLI -- Code quality toolkit for developers +# Qlty Cloud -- Fully automated Code Health Platform +# +# Try Qlty Cloud: https://qlty.sh +# +# For a guide to configuration, visit https://qlty.sh/d/config +# Or for a full reference, visit https://qlty.sh/d/qlty-toml +config_version = "0" + +exclude_patterns = [ + "config/", + "db/", + "dist/", + "**/.*", + "**/data/", + "**/runScripts/", + "**/com4FlowPy/", + "**/tinyHelper/", + "features/", + "**/node_modules/", + "script/", + "**/spec/", + "**/test/", + "**/tests/", + "Tests/", + "docs/", + "benchmarks/", + "**/vendor/", + "**/*_test.go", + "**/*.d.ts", + "**/*.cint", + "**/*.yml", + "**/*.ini", + "**/*.json", + "**/*.txt", + "**/*.conf", + "**/run*.py", + ".github/", + "*_min.*", + "*-min.*", + "*.min.*", + "**/*.d.ts", + "**/.yarn/**", + "**/bower_components/**", + "**/build/**", + "**/cache/**", + "**/config/**", + "**/db/**", + "**/deps/**", + "**/dist/**", + "**/extern/**", + "**/external/**", + "**/generated/**", + "**/Godeps/**", + "**/gradlew/**", + "**/mvnw/**", + "**/node_modules/**", + "**/protos/**", + "**/seed/**", + "**/target/**", + "**/testdata/**", + "**/vendor/**", + "**/assets/**", +] + +test_patterns = [ + "**/test/**", + "**/spec/**", + "**/*.test.*", + "**/*.spec.*", + "**/*_test.*", + "**/*_spec.*", + "**/test_*.*", + "**/spec_*.*", +] + +[smells] +mode = "comment" + +[smells.boolean_logic] +threshold = 4 +enabled = true + +[smells.file_complexity] +threshold = 66 +enabled = true + +[smells.return_statements] +threshold = 4 +enabled = true + +[smells.nested_control_flow] +threshold = 4 +enabled = true + +[smells.function_parameters] +threshold = 10 +enabled = true + +[smells.function_complexity] +threshold = 10 +enabled = true + +[smells.duplication] +enabled = true +threshold = 20 + +[[source]] +name = "default" +default = true + +[[plugin]] +name = "actionlint" + +[[plugin]] +name = "checkov" + +[[plugin]] +name = "golangci-lint" + +[[plugin]] +name = "osv-scanner" + +[[plugin]] +name = "prettier" + +[[plugin]] +name = "ripgrep" + +[[plugin]] +name = "ruff" +version = "0.5.3" + +[[plugin]] +name = "shellcheck" + +[[plugin]] +name = "shfmt" + +[[plugin]] +name = "trivy" +drivers = [ + "config", + "fs-vuln", +] + +[[plugin]] +name = "trufflehog" + +[[plugin]] +name = "yamllint" + +[[plugin]] +name = "black" + +#[[plugin]] +#name = "flake8" From 0a67fb988a973c3e162c9ce3660b84821101172a Mon Sep 17 00:00:00 2001 From: Felix Oesterle Date: Tue, 3 Jun 2025 20:36:57 +0200 Subject: [PATCH 2/3] docs(readme): add maintainability and code coverage badges sys(github-actions): remove Cython compilation from workflow --- .github/workflows/TestWithSinglePython.yml | 5 +---- README.md | 4 ++++ 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/.github/workflows/TestWithSinglePython.yml b/.github/workflows/TestWithSinglePython.yml index 5445f27..d38a539 100644 --- a/.github/workflows/TestWithSinglePython.yml +++ b/.github/workflows/TestWithSinglePython.yml @@ -32,12 +32,9 @@ jobs: run: | python -m pip install --upgrade pip pip install flake8 pytest pytest-cov - pip install numpy cython + pip install numpy pip install setuptools pip install pytest_mock - - name: Compile cython code - run: | - python setup.py build_ext --inplace --define CYTHON_TRACE - name: Install avaframe run: | pip install avaframe diff --git a/README.md b/README.md index a12382f..3dd4fd7 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,7 @@ # DebrisFrame How to install DebrisFrame can be found [here](https://docs.debrisframe.org/en/latest/installation.html#). + +[![Maintainability](https://qlty.sh/badges/0bf94b24-fee3-4fb1-9520-9e09adfe7195/maintainability.svg)](https://qlty.sh/gh/OpenNHM/projects/DebrisFrame) + +[![Code Coverage](https://qlty.sh/badges/0bf94b24-fee3-4fb1-9520-9e09adfe7195/test_coverage.svg)](https://qlty.sh/gh/OpenNHM/projects/DebrisFrame) \ No newline at end of file From 08db8bec3c1d7fbb8f774e52cd09db0cc3bf7e53 Mon Sep 17 00:00:00 2001 From: "qltysh[bot]" <168846912+qltysh[bot]@users.noreply.github.com> Date: Wed, 4 Jun 2025 07:03:27 +0000 Subject: [PATCH 3/3] =?UTF-8?q?=F0=9F=93=9D=20qlty=20fmt?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 3dd4fd7..cc7c9ba 100644 --- a/README.md +++ b/README.md @@ -4,4 +4,4 @@ How to install DebrisFrame can be found [here](https://docs.debrisframe.org/en/l [![Maintainability](https://qlty.sh/badges/0bf94b24-fee3-4fb1-9520-9e09adfe7195/maintainability.svg)](https://qlty.sh/gh/OpenNHM/projects/DebrisFrame) -[![Code Coverage](https://qlty.sh/badges/0bf94b24-fee3-4fb1-9520-9e09adfe7195/test_coverage.svg)](https://qlty.sh/gh/OpenNHM/projects/DebrisFrame) \ No newline at end of file +[![Code Coverage](https://qlty.sh/badges/0bf94b24-fee3-4fb1-9520-9e09adfe7195/test_coverage.svg)](https://qlty.sh/gh/OpenNHM/projects/DebrisFrame)