micheh / phpcs-gitlab Goto Github PK
View Code? Open in Web Editor NEWGitlab Report for PHP_CodeSniffer (display the violations in the Gitlab CI/CD Code Quality Report)
License: BSD 3-Clause "New" or "Revised" License
Gitlab Report for PHP_CodeSniffer (display the violations in the Gitlab CI/CD Code Quality Report)
License: BSD 3-Clause "New" or "Revised" License
Hi, @micheh.
Refer to Gitlab documentation location.path must be "relative path to the file containing the code quality violation"
But now it is absolute path that generates in widget wrong links to source code.
Example from my project, red line is base checkout path in runner:
That part should be trimmed with $CI_PROJECT_DIR
(doc)
phpcs-gitlab/src/Report/Gitlab.php
Line 41 in fd64e65
Hello!
First of all, thank you for this great piece of code, works beautifully.
What do you think about opening a PR to squizlabs/PHP_CodeSniffer for including the codeclimate spec?
Basically gitlab is using a subset of it, but still, both would benefit the community and didn't want to steal your work ๐
Cheers!
R
PS: found another really cool solution here:
php -dmemory_limit=-1 vendor/bin/phpcs --report=json . | jq '[.files | keys[] as $file | .[] | .messages | .[] as $msg | {type: "issue", check_name: $msg.source, categories: ["PHP", "phpcs"], fingerprint: ("\($file):\($msg.line):\($msg.source)"), description: $msg.message, location: { path: $file, lines: {begin: $msg.line, end: $msg.line }}}]'
Currently noticed, that gitlab reports old code style errors as new. Turns out that if error moved to different line the fingerprint for it changes as well and gitlab treat it as new code style problem. Did some digging and found out that codeclimate computes fingerprint differently. Instead of relaying on line, they read content of that line and strip whitespaces.
Reference to codeclimate fingerpint pr
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.