bluecadet/bc_composer_ci_tools 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

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

bluecadet/bc_composer_ci_tools

Composer 安装命令:

composer require bluecadet/bc_composer_ci_tools

包简介

Adds functionality for ci and composer tools built by Bluecadet.

README 文档

README

A custom PHP_CodeSniffer report formatter plugin designed for GitHub Actions, rendering code-style violations as rich Markdown tables.

Supported PHP Versions

  • PHP 7.4+
  • PHP 8.0+
  • PHP 8.1+
  • PHP 8.2+
  • PHP 8.3+

Requirements

  • PHP_CodeSniffer 3.x (squizlabs/php_codesniffer ^3.0)
  • Composer for installation

Installation

Install via Composer as a dev dependency:

composer require --dev bluecadet/bc_composer_ci_tools

Usage

Report Classes

This package provides three custom PHPCS report classes under Bluecadet\PHPCS\Report\:

1. MarkdownGithub (Recommended for GitHub Actions)

Formats output specifically for GitHub Actions step summaries using KaTeX math syntax for inline colors. Results render beautifully in the PR checks tab.

./vendor/bin/phpcs \
  --report=Bluecadet\\PHPCS\\Report\\MarkdownGithub \
  --standard=Drupal \
  --extensions=php,module,inc,install,test,profile,theme,info,txt \
  ./web/modules/custom >> $GITHUB_STEP_SUMMARY

Output includes:

  • Per-file violation tables with color-coded severity levels
  • Summary table of error/warning counts across all files
  • Total violation count
  • Organized details section for easy scanning

2. Markdown (Generic Markdown)

Uses inline HTML color spans for generic Markdown renderers that support HTML.

./vendor/bin/phpcs \
  --report=Bluecadet\\PHPCS\\Report\\Markdown \
  --standard=Drupal \
  ./web/modules/custom

3. MarkdownBase (Base Class)

Base implementation for custom report extensions. Extend this class to create custom report formats.

use Bluecadet\PHPCS\Report\MarkdownBase;

class CustomReport extends MarkdownBase {
  // Your custom implementation
}

Local Usage (Non-GitHub Actions)

For local code style checking:

# Drupal standard check
./vendor/bin/phpcs --standard=Drupal ./web/modules/custom

# DrupalPractice standard check
./vendor/bin/phpcs --standard=DrupalPractice ./web/modules/custom

# With Markdown output
./vendor/bin/phpcs \
  --report=Bluecadet\\PHPCS\\Report\\Markdown \
  --standard=Drupal \
  ./web/modules/custom

GitHub Actions Integration

See bluecadet/web-gh-actions for the ensure-composer-package action, which manages this package's installation in CI workflows.

Example workflow step:

- name: Run PHPCS with Markdown report
  run: |
    ./vendor/bin/phpcs -s \
      --report=Bluecadet\\PHPCS\\Report\\MarkdownGithub \
      --standard=Drupal \
      --extensions=php,module,inc,install,test,profile,theme,info,txt \
      ./web/modules/custom >> $GITHUB_STEP_SUMMARY

Authors

  • Pete Inge

License

GPL-2.0+

统计信息

  • 总下载量: 7.03k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 1
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 2
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: GPL-2.0
  • 更新时间: 2023-10-28

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固