承接 micheh/phpcs-gitlab 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

micheh/phpcs-gitlab

Composer 安装命令:

composer require micheh/phpcs-gitlab

包简介

GitLab Report for PHP_CodeSniffer (display the violations in the GitLab CI/CD Code Quality Report)

README 文档

README

Main workflow codecov

This library adds a custom report to PHP_CodeSniffer (phpcs) to generate a codequality artifact that can be used by GitLab CI/CD. The custom report is generated in 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 collect 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 Code Climate format.

Note: GitLab did not support multiple codequality artifacts before version 15.7. If you are using an earlier version of GitLab, you will not be able to see the violations from 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 needed).

It is also possible to specify the reports to be used in the phpcs.xml.dist file:

<arg name="report" value="full"/>
<arg name="report-\Micheh\PhpCodeSniffer\Report\Gitlab" value="phpcs-quality-report.json"/>

Upgrade from version 1 to 2

The usage of this package remains the same. However, the calculation of the fingerprint has been updated and is now based on the content instead of the line number. This has the advantage that lines with violations can move up or down and GitLab will not report them as new violations. When upgrading to version 2, it is likely that all violations will show up as changed once, since all fingerprints are new.

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.

micheh/phpcs-gitlab 适用场景与选型建议

micheh/phpcs-gitlab 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 12.62M 次下载、GitHub Stars 达 44, 最近一次更新时间为 2020 年 05 月 21 日, 在 PHP 生态内属于活跃度较高的组件。

它主要适用于以下技术方向: 「report」 「phpcs」 「gitlab」 「PHP_CodeSniffer」 「code quality」 「code climate」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。

我们在过去多个企业项目中使用过 micheh/phpcs-gitlab 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 micheh/phpcs-gitlab 我们能提供哪些服务?
定制开发 / 二次开发

基于 micheh/phpcs-gitlab 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

  • 总下载量: 12.62M
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 44
  • 点击次数: 31
  • 依赖项目数: 17
  • 推荐数: 0

GitHub 信息

  • Stars: 44
  • Watchers: 2
  • Forks: 3
  • 开发语言: PHP

其他信息

  • 授权协议: BSD-3-Clause
  • 更新时间: 2020-05-21