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

This package is not auto-updated.

Last update: 2024-04-19 04:08:49 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