GitLab : Code Quality report format#357
Merged
VincentLanglet merged 3 commits intoVincentLanglet:mainfrom Apr 27, 2025
Merged
Conversation
| */ | ||
| private function generateFingerprint(string $relativePath, Violation $violation): string | ||
| { | ||
| $base = $relativePath.$violation->getRuleName().$violation->getMessage(); |
Owner
There was a problem hiding this comment.
There is a violationId
You should try something like
$id = $violation->getIdentifier()?->toString() ?? $violation->getRuleName().$violation->getMessage()<
$hash = md5($relativePath.$id);
Contributor
Author
There was a problem hiding this comment.
This is intended, GitLab fingerprint is a bit weird.
See in this other project why I implemented the fingerprint this way : astral-sh/ruff#7203
I also added this explanation in the PHPdoc of this method.
Comment on lines
+72
to
+74
| $actual = json_encode($actual, \JSON_PRETTY_PRINT | \JSON_UNESCAPED_SLASHES); | ||
|
|
||
| static::assertSame($expected, $actual); |
Owner
There was a problem hiding this comment.
I'm not sure how to fix the issue for the Window build.
Maybe you could compare the json instead with assertJsonStringEqualsJsonString ?
Owner
|
If you rebase, I fixed the phpstan build with #358 |
9388c4b to
70270e5
Compare
Contributor
Author
|
Rebase on |
Owner
|
Hi @AlexisPPLIN, I reworked a little the reporter and just made a release ; please tell me if I broke something. |
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Hi,
I started to implement this wonderful tool in my GitLab CI/CD pipeline at work.
So I implemented the Code Quality report format : https://docs.gitlab.com/ci/testing/code_quality/#code-quality-report-format
I also added unit tests as asked.
I already used this reporter for a few months with no issues.
Have a nice day / night.