Security News
Fluent Assertions Faces Backlash After Abandoning Open Source Licensing
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
git-conventional-commits
Advanced tools
Please find attached Git Commit Convention
ensure you've installed npm
brew install node
with SSH:
ensure you've called ssh-add ~/.ssh/some_key_rsa
npm install -g git+ssh://git@github.com:qoomon/git-conventional-commits.git
or
with HTTPS:
npm install -g git+https://github.com/qoomon/git-conventional-commits.git
init [options] creates a config file template `git-conventional-commits.json`
version [options] determine version from conventional commits
changelog [options] generate change log from conventional commits
commit-msg-hook [options] <commit-msg-file> check for conventional commit message format
git-conventinal-commits init
git-conventional-commits.json
to your needsExample git-conventional-commits.json
{
"convention" : {
"commitTypes": [
"feat",
"fix",
"perf",
"refactor",
"style",
"test",
"build",
"ops",
"doc"
],
"commitScopes": [],
"releaseTagGlobPattern": "v[0-9]*.[0-9]*.[0-9]*",
"issueRegexPattern": "[A-Z]{3,}-\\d+"
},
"changelog" : {
"commitTypes": [
"feat",
"fix",
"perf",
"merge",
"?"
],
"commitScopes": [],
"commitIgnoreRegexPattern": "^WIP ",
"headlines": {
"feat": "Features",
"fix": "Bug Fixes",
"perf": "Performance Improvements",
"merge": "Merged Branches",
"breakingChange": "BREAKING CHANGES"
},
"commitUrl": "https://github.com/ACCOUNT/REPO/commit/%commit%",
"commitRangeUrl": "https://github.com/ACCOUNT/REPO/compare/%from%...%to%?diff=split",
"issueUrl": "https://JIRA_URL/browse/%issue%"
}
}
convention
commitTypes
an array of expected commit types
["feat", "fix", "doc", "style"]
commitScopes
an array of expected commit types
["ui", "database"]
releaseTagGlobPattern
glob pattern to filter for release tags
[0-9]+\.[0-9]+\.[0-9]+
)*
issueRegexPattern
regex pattern to find issue IDs
[A-Z]{3,}-\\d+
changelog
commitTypes
filter commits by type
convention.commitTypes
plus
merge
commits?
commits with unexpected message format["feat", "fix", "merge" , "?"]
commitScopes
filter commits by scopes
convention.commitScopes
["ui"]
commitIgnoreRegexPattern
filter commits by commit subject regex
^WIP
headlines
a map of headline identifier and actual headline
changelog.commitTypes
plus
breakingChange
Breaking Changes Section{ "feat": "Features", "fix": "Bug Fixes", "breakingChange": "BREAKING CHANGES"}
{ "feat": "Features", "fix": "Bug Fixes", "merge": "Merged Branches", "breakingChange": "BREAKING CHANGES"}
commitUrl
an URL template for generating markdown links to repository commits
%commit%
commit hash placeholderhttps://github.com/qoomon/git-conventional-commits/commit/%commit%
issueUrl
an URL template for generating markdown links to an issue tracker
%issue%
issue id placeholderhttps://jira.example.org/browse/%issue%
cd <repository-path>
mkdir .git-hooks
git config core.hooksPath .git-hooks
touch .git-hooks/commit-msg && chmod +x .git-hooks/commit-msg
.git-hooks/commit-msg
with your favorite editor and paste following script
#!/bin/sh
# fix for windows systems
PATH="/c/Program Files/nodejs:$HOME/AppData/Roaming/npm/:$PATH"
git-conventional-commits commit-msg-hook "$1"
.git-hooks/commit-msg
to repositorygit config core.hooksPath .git-hooks
git-conventional-changelog
git-conventional-changelog version
git commit -am'build(release): bump project version to <version>'
git-conventional-changelog changelog --release <version> --file 'CHANGELOG.md'
git commit -am'doc(release): create <version> change log entry'
git tag -a -m'build(release): <version>' '<version-prefix><version>'
git push
<type>(<optional scope>): <subject> empty separator line <optional body> empty separator line <optional footer>
Merge branch '<branch name>'
Follows default git merge message
Revert "<commit headline>" empty separator line This reverts commit <commit hash>. <optinal reason>
Follows default git revert message
feat
Commits, that adds a new featurefix
Commits, that fixes a bugrefactor
Commits, that rewrite/restructure your code, however does not change any behaviour
perf
Commits are refactor
commit, that improves performancestyle
Commits, that do not affect the meaning (white-space, formatting, missing semi-colons, etc)test
Commits, that add missing tests or correcting existing testsdoc
Commits, that affect documentation onlybuild
Commits, that affect build components like build tool, ci pipeline, dependencies, project version, ...ops
Commits, that affect operational components like infrastructure, backup, recovery, ...The scope
provides additional contextual information.
The subject
contains a succinct description of the change.
The body
should include the motivation for the change and contrast this with previous behavior.
The footer
should contain any information about Breaking Changes and is also the place to reference Issues that this commit refers to.
BREAKING CHANGES:
followed by space or two newlines. The rest of the commit message is then used for this.feat(shopping cart): add the amazing button
feat: remove ticket list endpoint
refers to JIRA-1337
BREAKING CHANGE: ticket enpoints no longer supports list all entites.
fix: add missing parameter to service call
The error occurred because of <reasons>.
build: release version 1.0.0
build: update dependencies
refactor: implement calculation method as recursion
style: remove empty line
revert: refactor: implement calculation method as recursion
This reverts commit 221d3ec6ffeead67cee8c730c4a15cf8dc84897a.
FAQs
git conventional commits util
The npm package git-conventional-commits receives a total of 2,853 weekly downloads. As such, git-conventional-commits popularity was classified as popular.
We found that git-conventional-commits demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
Research
Security News
Socket researchers uncover the risks of a malicious Python package targeting Discord developers.
Security News
The UK is proposing a bold ban on ransomware payments by public entities to disrupt cybercrime, protect critical services, and lead global cybersecurity efforts.