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
PixelPerfectphpcs ruleset (PixelPerfect/ruleset.xml) — extendsMagento2, with the minimal-comments tuning (no forced@param/@returndocblock noise).- Shared phpstan config (
phpstan.neon) — level 6 + thebitexpert/phpstan-magentobootstrap, 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
- 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 …). - AI attribution rejection — rejects commit messages that contain
Co-Authored-ByorGenerated withreferencing 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
- 点击次数: 2
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: proprietary
- 更新时间: 2026-07-02