jover_be/drupal-code-check
Composer 安装命令:
composer require jover_be/drupal-code-check
包简介
A Git pre-commit hook to check Drupal Coding Standards and more.
README 文档
README
A Git pre-commit hook to check Drupal Coding Standards and more.
Description
This Git pre-commit hook will be active on your Composer based Drupal project.
Things which will be checked in the pre-commit hook:
- Syntax checking using PHP Linter
- Automatically try to match code style via PHP Code Sniffer Beautifier and Fixer
- Coding standards checking using PHP Code Sniffer
- Blacklisted strings checking/validation
Note that files of the following origins are not checked:
- Drupal Core
- Contributed Modules
- Contributed Libraries
- Contributed Themes
- Contributed Profiles
Getting started
Prerequisites
- Composer
- Composer based Drupal project
- PHP 5.4 or higher
Installation
Add this project as a composer dependency on your Composer based Drupal project.
composer require jover_be/drupal-code-check
And don't forget to update...
composer update jover_be/drupal-code-check
In order to activate the Git Hooks, update your composer.json file like following:
{
"scripts": {
"post-install-cmd": [
"jover_be\\drupal_code_check\\GitHooks::create"
],
"post-update-cmd": [
"jover_be\\drupal_code_check\\GitHooks::create",
]
}
}
Development requirement
In case you want to install it as a development requirement (require-dev), make use of the project neronmoon/scriptsdev in order to execute the scripts only in case your project was installed in development mode.
composer require --dev neronmoon/scriptsdev composer require --dev jover_be/drupal-code-check
And instead, you should be using the scripts-dev part as described by
{
"extra": {
"scripts-dev": {
"post-install-cmd": [
"jover_be\\drupal_code_check\\GitHooks::create"
],
"post-update-cmd": [
"jover_be\\drupal_code_check\\GitHooks::create",
]
}
}
}
Author
License
This project is licensed under the MIT License - see the LICENSE file for details.
统计信息
- 总下载量: 2.63k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 5
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2016-12-16