hdnet / hdnet-standards
There is no license information available for the latest version (v1.0.7) of this package.
HDNET coding standards via githook mechanism
v1.0.7
2021-04-22 13:17 UTC
Requires
- php: ^7.4||^8.0
- captainhook/captainhook: ^5.5
- friendsofphp/php-cs-fixer: ^2.18
- ramsey/conventional-commits: ^1.1
- sclable/xml-lint: ^0.4.0
- seld/jsonlint: ^1.8
- symfony/yaml: ^5.2
Requires (Dev)
- phpunit/phpunit: ^9.5
This package is not auto-updated.
Last update: 2023-06-01 23:35:51 UTC
README
Forces HDNET's coding standards on commits
Installation
- run
composer require hdnet/hdnet-standards
in your project
Usage
- copy the .php_cs into the root directory of your project and configure the finder if necessary
- create a captainhook.json in the root directory of your project (Example: captainhookSample.json)
- [Usually you would need to
vendor/bin/captainhook configure
, but creating the captainhook.json by hand does that for you] - Activate captainhook with
vendor/bin/captainhook install
- Configure HDNET Standards to your project
Configuration
- Change the Jira-Project
"action": "\\HDNET\\Standards\\Hook\\Message\\JiraIssue",
"options": {
"project": "HDNET"
}
- Change path to json-, xml- and yaml-files
{
"action": "\\HDNET\\Standards\\Hook\\JsonHook",
"options": {
"directory" : "src/"
}
},
{
"action": "\\HDNET\\Standards\\Hook\\YamlHook",
"options": {
"directory" : "src/"
}
},
{
"action": "\\HDNET\\Standards\\Hook\\XmlHook",
"options": {
"directory" : "src/"
}
}
Instead of validating the commit message with the rules of Chris Beams, you can use conventional commits with the following configuration in the captainhook.json:
{
"action": "\\HDNET\\Standards\\Hook\\Message\\ConventionalCommits",
"options": {
"config": {
"typeCase": null,
"types": [],
"scopeCase": null,
"scopeRequired": false,
"scopes": [],
"descriptionCase": null,
"descriptionEndMark": null,
"bodyRequired": false,
"bodyWrapWidth": null,
"requiredFooters": []
}
}
}
Tooling
lando phpunit
=> Execute unit tests