[FEATURE] add codeclimate iteration zero#93
Conversation
martin-helmich
left a comment
There was a problem hiding this comment.
Looking good so far! 👍 I've commented a few nitpicks regarding your PR, but nothing major. To top this of, a test case for the new printer (as you've already noted in #92) would be awesome.
Maybe we could also add a "Integrating with Gitlab" section to the README (either within this PR, if you want, or later in a separate change).
| 'type' => 'issue', | ||
| 'check_name' => $issue->getSource(), | ||
| 'description' => $issue->getMessage(), | ||
| 'categories' => ['Style'], |
There was a problem hiding this comment.
Not sure if all checks fit into the Style category. For instance, the DuplicateAssignmentSniff might also fit into the Bug Risk category.
There was a problem hiding this comment.
Do you have a hint how to connect your issue to the categorie? From your code I have not seen an entry point to extract an issue category.
| 'description' => $issue->getMessage(), | ||
| 'categories' => ['Style'], | ||
| 'location' => [ | ||
| 'path' => $file->getFilename(), |
There was a problem hiding this comment.
Not entirely sure -- I think that $file->getFilename() might possibly return the absolute file name, whereas the code climate spec requires the relative file name (to the working dir, presumably).
With #91 (still work-in-progress, however), there is a utility class Helmich\TypoScriptLint\Linter\ReportPrinter\PathUtils coming in that implements just this; maybe we could already pull that class into this PR.
There was a problem hiding this comment.
I know, can you tell me, maybe it makes sense to expose an getAbsolutePath and getRelativePath function from the file object? You could store the pathes splitted in 2 parts and return that easily.
Co-Authored-By: Martin Helmich <kontakt@martin-helmich.de>
|
Thanks a lot for your input. As i said, it was the first itaration for checking if it's possible - and yes it needs some more care :) |
|
What's the status here? Would love to see this kind of outputs for GitLab. |
#92
#92