定制 pixelperfectat/coding-standard 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

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

pixelperfectat/coding-standard

Composer 安装命令:

composer require pixelperfectat/coding-standard

包简介

PixelPerfect shared Magento module coding standard: phpcs ruleset (extends Magento2), phpstan config, and the pinned QA toolchain.

README 文档

README

Shared coding standard + QA toolchain for PixelPerfect Magento modules. Bump this package (one place) and every module inherits the change.

What it provides

  • PixelPerfect phpcs ruleset (PixelPerfect/ruleset.xml) — extends Magento2, with the minimal-comments tuning (no forced @param/@return docblock noise).
  • Shared phpstan config (phpstan.neon) — level 6 + the bitexpert/phpstan-magento bootstrap, resolved via %currentWorkingDirectory% so it works whether the module is the composer root (CI) or a local clone.
  • The pinned QA tools as dependencies (phpcs, magento-coding-standard, phpstan, bitexpert/phpstan-magento, parallel-lint, composer-normalize) — so consuming modules only add this one package (+ their own phpunit).

Use in a module

composer.json:

"require-dev": { "pixelperfectat/coding-standard": "^0.1.0", "phpunit/phpunit": "^9.6" }

phpcs.xml:

<ruleset name="Module"><file>.</file>
  <exclude-pattern>*/Test/*</exclude-pattern><exclude-pattern>*/vendor/*</exclude-pattern>
  <exclude-pattern>*/docs/*</exclude-pattern><exclude-pattern>*/view/*</exclude-pattern>
  <rule ref="PixelPerfect"/>
</ruleset>

phpstan.neon.dist:

includes:
    - vendor/pixelperfectat/coding-standard/phpstan.neon
parameters:
    paths: [ ... module dirs ... ]
    # module-specific excludePaths / ignoreErrors here

Git hooks (captainhook)

This package ships a captainhook.json with two hooks. After installing this package in a consuming module, activate the hooks once with:

vendor/bin/captainhook install -f -c vendor/pixelperfectat/coding-standard/captainhook.json

commit-msg

  1. Keyword format — the subject line must start with one of: Add, Implement, Introduce, Update, Refactor, Improve, Change, Bump, Deprecate, Remove, Delete, Drop, Fix, Correct, Resolve, Security (optionally preceded by an issue reference in brackets, e.g. [PROJ-123] Fix …).
  2. AI attribution rejection — rejects commit messages that contain Co-Authored-By or Generated with referencing Claude, Gemini, Copilot, or ChatGPT.

pre-commit

Runs composer lint and composer cs before every commit to catch lint/style errors early.

Consumed via a git VCS repositories entry (auth CI_JOB_TOKEN) until the GitLab Composer Registry is set up.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: proprietary
  • 更新时间: 2026-07-02

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固