diff --git a/.codeclimate.yml b/.codeclimate.yml deleted file mode 100644 index 4a3c6163..00000000 --- a/.codeclimate.yml +++ /dev/null @@ -1,12 +0,0 @@ -version: "2" -exclude_patterns: - - "integrationtests/" -checks: - method-lines: - config: - threshold: 120 - method-complexity: - config: - threshold: 15 - return-statements: - enabled: false diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6b3910ef..b560af9d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -111,6 +111,14 @@ jobs: uses: codecov/test-results-action@v1 with: token: ${{ secrets.CODECOV_TOKEN }} + - name: Upload coverage to Qlty + if: ${{ matrix.os != 'windows-latest' && matrix.php_version == '8.1' && matrix.dependencies_level != '--prefer-lowest' }} + uses: qltysh/qlty-action/coverage@v1 + with: + token: ${{ secrets.QLTY_COVERAGE_TOKEN }} + files: coverage.xml + env: + QLTY_COVERAGE_TOKEN: ${{ secrets.QLTY_COVERAGE_TOKEN }} slack-notify: needs: [run-tests, style-checks] @@ -122,7 +130,7 @@ jobs: id: slack uses: slackapi/slack-github-action@v1.23.0 with: - # Slack channel id, channel name, or user id to post message. + # Slack channel id, channel name, or user id to post a message. # See also: https://api.slack.com/methods/chat.postMessage#channels channel-id: '#mo4' # For posting a simple plain text message diff --git a/.qlty/.gitignore b/.qlty/.gitignore new file mode 100644 index 00000000..30366188 --- /dev/null +++ b/.qlty/.gitignore @@ -0,0 +1,7 @@ +* +!configs +!configs/** +!hooks +!hooks/** +!qlty.toml +!.gitignore diff --git a/.qlty/configs/.yamllint.yaml b/.qlty/configs/.yamllint.yaml new file mode 100644 index 00000000..d22fa779 --- /dev/null +++ b/.qlty/configs/.yamllint.yaml @@ -0,0 +1,8 @@ +rules: + document-start: disable + quoted-strings: + required: only-when-needed + extra-allowed: ["{|}"] + key-duplicates: {} + octal-values: + forbid-implicit-octal: true diff --git a/.qlty/qlty.toml b/.qlty/qlty.toml new file mode 100644 index 00000000..3fbf1b19 --- /dev/null +++ b/.qlty/qlty.toml @@ -0,0 +1,84 @@ +# 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.*", + "**/.yarn/**", + "**/*.d.ts", + "**/assets/**", + "**/bower_components/**", + "**/build/**", + "**/cache/**", + "**/config/**", + "**/db/**", + "**/deps/**", + "**/dist/**", + "**/extern/**", + "**/external/**", + "**/generated/**", + "**/Godeps/**", + "**/gradlew/**", + "**/mvnw/**", + "**/node_modules/**", + "**/protos/**", + "**/seed/**", + "**/target/**", + "**/templates/**", + "**/testdata/**", + "**/vendor/**", "integrationtests/", +] + +test_patterns = [ + "**/test/**", + "**/spec/**", + "**/*.test.*", + "**/*.spec.*", + "**/*_test.*", + "**/*_spec.*", + "**/test_*.*", + "**/spec_*.*", +] + +[smells] +mode = "comment" + +[smells.boolean_logic] +threshold = 4 + +[smells.file_complexity] +threshold = 55 + +[smells.return_statements] +threshold = 4 +enabled = false + +[smells.nested_control_flow] +threshold = 4 + +[smells.function_parameters] +threshold = 4 + +[smells.function_complexity] +threshold = 16 + +[smells.duplication] +enabled = true +threshold = 20 + +[[source]] +name = "default" +default = true diff --git a/README.md b/README.md index b45e51e3..10b07379 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ Provides a PHP CodeSniffer ruleset for the MO4 coding standard [![Build Status](https://github.com/mayflower/mo4-coding-standard/actions/workflows/ci.yml/badge.svg)](https://github.com/mayflower/mo4-coding-standard/actions) [![Code Coverage](https://codecov.io/gh/mayflower/mo4-coding-standard/branch/master/graph/badge.svg)](https://codecov.io/gh/mayflower/mo4-coding-standard/branch/master/) -[![Codeclimate Maintainability](https://api.codeclimate.com/v1/badges/16114548a0315d993868/maintainability)](https://codeclimate.com/github/mayflower/mo4-coding-standard/maintainability) +[![Qlty Maintainability](https://qlty.sh/gh/mayflower/projects/mo4-coding-standard/maintainability.svg)](https://qlty.sh/gh/mayflower/projects/mo4-coding-standard) [![SonarQube Maintainability](https://sonarcloud.io/api/project_badges/measure?project=mayflower_mo4-coding-standard&metric=sqale_rating)](https://sonarcloud.io/dashboard?id=mayflower_mo4-coding-standard) [![Latest Stable Version](https://poser.pugx.org/mayflower/mo4-coding-standard/v/stable)](https://packagist.org/packages/mayflower/mo4-coding-standard)