Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Output for the code quality widget in GitLab CI #6697

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

VitalyArt
Copy link

@VitalyArt VitalyArt commented Jan 26, 2025

Adoption of the CodeClimate format for GitLab CI integration

Specification: https://github.com/codeclimate/platform/blob/master/spec/analyzers/SPEC.md#data-types

Example

Run command:

php bin/rector process bin --output-format=gitlab --dry-run

Output:

[
    {
        "fingerprint": "7e5f879fe12ff579e958c9935e9ee034",
        "type": "issue",
        "categories": [
            "Bug Risk"
        ],
        "severity": "blocker",
        "description": "Syntax error, unexpected T_VARIABLE",
        "check_name": "",
        "location": {
            "path": "bin/test-fixture-stats.php",
            "lines": {
                "begin": 17
            }
        }
    },
    {
        "fingerprint": "183de697ac3261bb7f85226e0ef2253a",
        "type": "issue",
        "categories": [
            "Style"
        ],
        "severity": "minor",
        "description": "MultiDirnameRector / AddVoidReturnTypeWhereNoReturnRector",
        "content": {
            "body": "--- Original\n+++ New\n@@ -71,7 +71,7 @@\n         $this->loadIfExistsAndNotLoadedYet('vendor/autoload.php');\n     }\n \n-    public function autoloadFromCommandLine()\n+    public function autoloadFromCommandLine(): void\n     {\n         $cliArgs = $_SERVER['argv'];\n \n"
        },
        "check_name": "MultiDirnameRector / AddVoidReturnTypeWhereNoReturnRector",
        "location": {
            "path": "bin/rector.php",
            "lines": {
                "begin": 70
            }
        }
    }
]

Code Quality widget:

image

@VitalyArt VitalyArt force-pushed the output-format-code-climate branch from fd5bfc4 to 48be2ad Compare January 26, 2025 18:50
@VitalyArt VitalyArt force-pushed the output-format-code-climate branch from 48be2ad to 219df95 Compare January 27, 2025 05:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant