All Projects → micheh → phpcs-gitlab

micheh / phpcs-gitlab

Licence: BSD-3-Clause license
Gitlab Report for PHP_CodeSniffer (display the violations in the Gitlab CI/CD Code Quality Report)

Programming Languages

PHP
23972 projects - #3 most used programming language

Projects that are alternatives of or similar to phpcs-gitlab

Phpqa
Docker image that provides static analysis tools for PHP
Stars: ✭ 853 (+2841.38%)
Mutual labels:  php-codesniffer, code-quality
wptide
🌊 Tide is a series of automated tests run against every WordPress.org theme and plugin
Stars: ✭ 77 (+165.52%)
Mutual labels:  php-codesniffer, phpcs
Reviewdog
🐶 Automated code review tool integrated with any code analysis tools regardless of programming language
Stars: ✭ 4,541 (+15558.62%)
Mutual labels:  gitlab, code-quality
codeclimate-phpcodesniffer
Code Climate Engine for PHP Code Sniffer
Stars: ✭ 27 (-6.9%)
Mutual labels:  php-codesniffer, code-quality
Phpcompatibility
PHP Compatibility check for PHP_CodeSniffer
Stars: ✭ 1,705 (+5779.31%)
Mutual labels:  php-codesniffer, phpcs
Wordpress Coding Standards
PHP_CodeSniffer rules (sniffs) to enforce WordPress coding conventions
Stars: ✭ 2,070 (+7037.93%)
Mutual labels:  php-codesniffer, phpcs
phpcs-psr4-sniff
[READ-ONLY] PHP_CodeSniffer sniff that checks class name matches PSR-4 project structure.
Stars: ✭ 23 (-20.69%)
Mutual labels:  php-codesniffer, phpcs
redmine merge request links
Display links to associated Gitlab merge requests and GitHub pull requests on Redmine's issue page.
Stars: ✭ 32 (+10.34%)
Mutual labels:  gitlab
moadsd-ng
The MOADSD-NG project does provide a simple way to setup a hybrid cloud security demo, playground and learning environment within the clouds.
Stars: ✭ 13 (-55.17%)
Mutual labels:  gitlab
infrastructure
Flux based GitOps repository for my home lab infrastructure.
Stars: ✭ 14 (-51.72%)
Mutual labels:  gitlab
gitlabreports
GitLab Reports is a small web app that allows GitLab users to generate reports of their project milestones with totals of estimated and spent time. Check https://gitlab.com/cosango/gitlabreports for latest code. App URL =>
Stars: ✭ 16 (-44.83%)
Mutual labels:  gitlab
slim-skeleton
Slim Framework skeleton application following MVC construction
Stars: ✭ 18 (-37.93%)
Mutual labels:  phpcs
go-zero-looklook
🔥基于go-zero(go zero) 微服务全技术栈开发最佳实践项目。Develop best practice projects based on the full technology stack of go zero (go zero) microservices.
Stars: ✭ 2,691 (+9179.31%)
Mutual labels:  gitlab
gitlab-release-note-generator
A Gitlab release note generator
Stars: ✭ 88 (+203.45%)
Mutual labels:  gitlab
YappyGitLab
A GitLab monitor bot for Discord
Stars: ✭ 51 (+75.86%)
Mutual labels:  gitlab
godoc-generate
Default godoc generator - make your first steps towards better code documentation
Stars: ✭ 21 (-27.59%)
Mutual labels:  code-quality
GitLabCLI
Cross platform GitLab CLI tool
Stars: ✭ 28 (-3.45%)
Mutual labels:  gitlab
10-days-of-git-and-github
asabeneh.github.io/10-days-of-git-and-github/
Stars: ✭ 786 (+2610.34%)
Mutual labels:  gitlab
gitlab-vagrant
Basic GitLab Vagrant Environment
Stars: ✭ 30 (+3.45%)
Mutual labels:  gitlab
cache
Aplus Framework Cache Library
Stars: ✭ 18 (-37.93%)
Mutual labels:  gitlab

Gitlab Report for PHP_CodeSniffer

Main workflow codecov

This library adds a custom report to PHP_CodeSniffer (phpcs) to generate a codequality artifact, which can be used by Gitlab CI/CD. The custom report will be generated in the Code Climate format and allows Gitlab CI/CD to display the violations in the Code Quality report.

Installation

Install this library using Composer:

composer require --dev micheh/phpcs-gitlab

Then adjust your .gitlab-ci.yml to run PHP_CodeSniffer with the custom reporter and to gather the codequality artifacts:

phpcs:
  script: vendor/bin/phpcs --report=full --report-\\Micheh\\PhpCodeSniffer\\Report\\Gitlab=phpcs-quality-report.json
  artifacts:
    reports:
      codequality: phpcs-quality-report.json

The example above uses two reports, one to display in the build log (full) and one to generate the codequality artifact file in the Code Climate format.

Note: Gitlab currently does not support multiple codequality artifacts. You will not be able to display the violations of multiple tools (e.g. PHP Code Sniffer & PHPStan) in the Code Quality report.

Inside the codequality artifact, Gitlab expects relative paths to the files with violations. To generate relative paths with PHP Code Sniffer, set the basepath argument in your phpcs.xml.dist configuration file with <arg name="basepath" value="."/> or run phpcs with --basepath=. (adjust the base path as necessary).

References

License

The files in this archive are licensed under the BSD-3-Clause license. You can find a copy of this license in LICENSE.md.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].