@guidecx/config-branchlint
v0.0.1-alpha.0
Published
Branch linting script for use in GCX applications
Readme
GCX Branchlint Script
Installing script into another project
The index.js file exports the branchlint node script. In another project, you can do the following to include these linting rules:
- at the root of the other project, install the package with
npm install --save-dependency @guidecx/config-branchlint - if you haven't installed
huskyandlint-staged, install them. according to the lint-staged docs, the easiest way to do this is by runningnpx mrm lint-staged. - in your
package.jsonfile, include the following to your husky commands:"husky": { "hooks": { "pre-commit": "node ./node_modules/@guidecx/config-branchlint" } }- Alternatively, if the current app has a
.husky/folder that manages your scripts, addnpm run branchlintinto the bash file forpre-commit, and then create an npm script in yourpackage.jsonlike:"scripts": { "branchlint": "node ./node_modules/@guidecx/config-branchlint" }
- Alternatively, if the current app has a
- if everything was done correctly, making a
git commitwill now enforce our branch linting rules
Example branchlint patterns
When using this package, all branch names must match the following pattern:
currentUser/type/chStory/simple-descriptionwhere 'type' is an enum [chore, feat, fix, revert], chStory is a positive integer that matches a clubhouse story number prefaced with ch, and simple-description is a brief description of the changes made.
Based on the rules file, these are some of the patterns that are considered valid:
agarvin/feat/ch1823/add-unit-tests-to-view
iclaw/chore/ch891/disable-time-entry-page
jgomez/revert/ch2761/revert-disable-time-entry-page