From b74b791c7e5dc6745deaaab4d8c33ace0ceb3824 Mon Sep 17 00:00:00 2001 From: Cristiano Cinotti Date: Mon, 21 Apr 2025 17:24:49 +0200 Subject: [PATCH] Move from Codeclimate to Qlty --- .github/workflows/coverage_report.yml | 11 +-- .github/workflows/test.yml | 6 +- .qlty/qlty.toml | 106 +++++++++++++++++++++++ README.md | 7 +- composer.json | 4 +- src/Exception/ParamResolverException.php | 2 +- src/ParamResolver.php | 2 +- src/Validator.php | 2 +- 8 files changed, 122 insertions(+), 18 deletions(-) create mode 100644 .qlty/qlty.toml diff --git a/.github/workflows/coverage_report.yml b/.github/workflows/coverage_report.yml index 8e83d38..9347537 100644 --- a/.github/workflows/coverage_report.yml +++ b/.github/workflows/coverage_report.yml @@ -19,9 +19,10 @@ jobs: uses: ramsey/composer-install@v3 with: composer-options: "--prefer-dist --optimize-autoloader" - - name: Test & publish code coverage - uses: paambaati/codeclimate-action@v8.0.0 - env: - CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }} + - name: Build the code coverage report + run: composer coverage:clover + - name: Upload code coverage report + uses: qltysh/qlty-action/coverage@v1 with: - coverageCommand: "composer coverage:clover" + token: ${{ secrets.QLTY_COVERAGE_TOKEN }} + files: clover.xml \ No newline at end of file diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index c6c7e8a..aab9dea 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -8,7 +8,7 @@ jobs: fail-fast: false matrix: operating-system: [ubuntu-latest, windows-latest, macOS-latest] - php-versions: ['8.2', '8.3'] + php-versions: ['8.2', '8.3', '8.4'] runs-on: ${{ matrix.operating-system }} steps: - name: Set autocrlf on windows @@ -25,9 +25,5 @@ jobs: uses: ramsey/composer-install@v3 with: composer-options: "--prefer-dist --optimize-autoloader" - - name: Check coding standard - run: composer cs:check - - name: Static analysis tool - run: composer analytics - name: Test suite run: composer test diff --git a/.qlty/qlty.toml b/.qlty/qlty.toml new file mode 100644 index 0000000..309c914 --- /dev/null +++ b/.qlty/qlty.toml @@ -0,0 +1,106 @@ +# 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 = [ + "*_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_*.*", + "**/tests/**" +] + +[smells] +mode = "comment" + +[[source]] +name = "default" +default = true + +[[plugin]] +name = "actionlint" + +[[plugin]] +name = "dotenv-linter" +mode = "comment" + +[[plugin]] +name = "golangci-lint" +mode = "comment" + +[[plugin]] +name = "markdownlint" +mode = "comment" + +[[plugin]] +name = "php-codesniffer" +mode = "comment" + +[[plugin]] +name = "php-cs-fixer" + +[[plugin]] +name = "prettier" + +[[plugin]] +name = "radarlint-php" + +[[plugin]] +name = "ripgrep" +mode = "comment" + +[[plugin]] +name = "trivy" +drivers = [ + "config", + "fs-vuln", +] + +[[plugin]] +name = "trufflehog" + +[[plugin]] +name = "yamllint" diff --git a/README.md b/README.md index 6dbc7b3..b75eda4 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,8 @@ # Parameter Resolver ![Test Suite](https://github.com/susina/param-resolver/actions/workflows/test.yml/badge.svg) -[![Test Coverage](https://api.codeclimate.com/v1/badges/b2ce3e357481f2742e36/test_coverage)](https://codeclimate.com/github/susina/param-resolver/test_coverage) -[![Maintainability](https://api.codeclimate.com/v1/badges/b2ce3e357481f2742e36/maintainability)](https://codeclimate.com/github/susina/param-resolver/maintainability) +[![Maintainability](https://qlty.sh/badges/15b08566-7e7a-46ca-b120-2e24af96de83/maintainability.svg)](https://qlty.sh/gh/susina/projects/param-resolver) +[![Code Coverage](https://qlty.sh/badges/15b08566-7e7a-46ca-b120-2e24af96de83/test_coverage.svg)](https://qlty.sh/gh/susina/projects/param-resolver) ParamResolver is a small class to resolve parameters in configuration arrays. It's heavily inspired on [Symfony ParameterBag](src/Symfony/Component/DependencyInjection/ParameterBag/ParameterBag.php) class. @@ -75,7 +75,8 @@ You can escape the special character % by doubling it: jeans property now contains the string '20%'. -> _Note_: Both keys and values of your array can contain parameters. +> [!Note] +> Both keys and values of your array can contain parameters. ### Special parameters: environment variables diff --git a/composer.json b/composer.json index 479d762..cb5d5ea 100644 --- a/composer.json +++ b/composer.json @@ -23,9 +23,9 @@ } }, "require-dev": { - "psalm/phar": "^5", + "psalm/phar": "^6", "susina/coding-standard": "^2", - "pestphp/pest": "^2" + "pestphp/pest": "^3" }, "scripts": { "analytics": "php vendor/bin/psalm.phar", diff --git a/src/Exception/ParamResolverException.php b/src/Exception/ParamResolverException.php index 6bc7726..c6b46d4 100644 --- a/src/Exception/ParamResolverException.php +++ b/src/Exception/ParamResolverException.php @@ -15,6 +15,6 @@ namespace Susina\ParamResolver\Exception; -class ParamResolverException extends \RuntimeException +final class ParamResolverException extends \RuntimeException { } diff --git a/src/ParamResolver.php b/src/ParamResolver.php index b6cdfb2..0d58e1b 100644 --- a/src/ParamResolver.php +++ b/src/ParamResolver.php @@ -18,7 +18,7 @@ use Generator; use Susina\ParamResolver\Exception\ParamResolverException; -class ParamResolver +final class ParamResolver { /** * If the array with parameters is resolved. diff --git a/src/Validator.php b/src/Validator.php index 44c5ed4..9b5cabe 100644 --- a/src/Validator.php +++ b/src/Validator.php @@ -21,7 +21,7 @@ /** * Utility class to perform validations. */ -class Validator +final class Validator { /** * Check if a value is only numeric or string.