jdolba/silverstripe-coding-standards
Composer 安装命令:
composer require jdolba/silverstripe-coding-standards
包简介
Coding standards and more for your SilverStripe project
README 文档
README
Set of definition and coding standards rules for your SilverStripe project
Install
Via Composer
composer require --dev jdolba/silverstripe-coding-standards ^0.1
Usage
Example of usage with composer scripts:
- Add scripts to your composer.json file
"scripts": { "silverstripe-standards": [ "@php-lint", "@phpcs" ], "php-lint": "parallel-lint app/src app/tests", "phpcs": "phpcs app/src app/tests --standard=vendor/jdolba/silverstripe-coding-standards/definitions/php/phpcs-ss4.xml --extensions=php --encoding=utf-8", "phpcbf": "phpcbf app/src app/tests --standard=vendor/jdolba/silverstripe-coding-standards/definitions/php/phpcs-ss4.xml --extensions=php --encoding=utf-8", "phpcs-fix": "@phpcbf" },
- then run:
composer silverstripe-standards
- to fix your Standards violations you can run
composer phpcs-fix
# or
composer phpcbf
Custom rules
you can also customize rules by adding phpcs.xml file directly to you project root:
cp vendor/jdolba/silverstripe-coding-standards/skeletons/phpcs.xml phpcs.xml
don't forgot to change paths in composer scripts (--standard=phpcs.xml)
.editorconfig
you can use prepared .editorconfig file (see https://editorconfig.org/)
cp vendor/jdolba/silverstripe-coding-standards/skeletons/.editorconfig .editorconfig
Credits
License
The MIT License (MIT). Please see License File for more information.
统计信息
- 总下载量: 4.66k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2019-05-23