Output for the code quality widget in GitLab CI#6697
Merged
samsonasik merged 1 commit intorectorphp:mainfrom Jan 28, 2025
Merged
Output for the code quality widget in GitLab CI#6697samsonasik merged 1 commit intorectorphp:mainfrom
samsonasik merged 1 commit intorectorphp:mainfrom
Conversation
fd5bfc4 to
48be2ad
Compare
48be2ad to
219df95
Compare
samsonasik
reviewed
Jan 27, 2025
219df95 to
601fe26
Compare
samsonasik
approved these changes
Jan 28, 2025
Member
|
Let's give it a try, thank you @VitalyArt |
Contributor
|
Is there a way to get console output in CI while also generating a report file in the Gitlab format? |
Contributor
Author
@mickverm you can use the Example: php bin/rector process bin --output-format=gitlab --dry-run | tee output.json |
Contributor
|
I was thinking something more in line of PHPUnit, where I can get the regular output in the CI console and generate a coverage report at the same time. |
Contributor
Author
|
@mickverm |
Contributor
|
This pull request has been automatically locked because it has been closed for 150 days. Please open a new PR if you want to continue the work. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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:
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: