Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

git-conventional-commits

Package Overview
Dependencies
Maintainers
1
Versions
43
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

git-conventional-commits - npm Package Compare versions

Comparing version 2.1.2 to 2.2.0

5

lib/commands/config.js

@@ -89,3 +89,6 @@ const fs = require("fs");

config.convention.msgRegex = /^(?<type>\w+)(?:\((?<scope>[^()]+)\))?(?<breaking>!)?:\s*(?<description>.+)/i;
config.convention.msgMergeRegex = /^Merge branch +["'](?<branch>.+)['"]/i;
config.convention.msgMergeRegexList = [
/^Merge (?<description>.+)/i, // Default Git merge message
/^Merged in (?<description>.+)/i, // Bitbucket merge message e.g. "Merged in team/repository/branch"
];
config.convention.msgRevertRegex = /^Revert +["'](?<subject>.+)['"]/i;

@@ -92,0 +95,0 @@ config.convention.bodyRevertRegex = /(?<hash>\S+)\.+?$/im; // \S - no white spaces

13

lib/gitCommitConvention.js

@@ -97,6 +97,6 @@ const Git = require("./git");

} else {
const msgMergeMatch = commit.subject.match(convention.msgMergeRegex);
const msgMergeMatch = getFirstMatch(commit.subject, convention.msgMergeRegexList);
if (msgMergeMatch) {
conventionalSubject.type = 'merge';
conventionalSubject.description = msgMergeMatch.groups.branch;
conventionalSubject.description = msgMergeMatch.groups.description;
} else {

@@ -136,2 +136,11 @@ const msgRevertMatch = commit.subject.match(convention.msgRevertRegex);

}
function getFirstMatch(string, regexList) {
for (const regex of regexList) {
const match = string.match(regex);
if (match) {
return match;
}
}
}
};
{
"name": "git-conventional-commits",
"version": "2.1.2",
"version": "2.2.0",
"description": "git conventional commits util",

@@ -14,3 +14,3 @@ "licence": "GPLv3",

"dependencies": {
"yargs": "^17.3.1"
"yargs": "^17.6.2"
},

@@ -17,0 +17,0 @@ "devDependencies": {

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc