cz-conventional-changelog
Advanced tools
Comparing version 3.2.1 to 3.3.0
@@ -24,5 +24,5 @@ 'format cjs'; | ||
var filterSubject = function(subject) { | ||
var filterSubject = function(subject, disableSubjectLowerCase) { | ||
subject = subject.trim(); | ||
if (subject.charAt(0).toLowerCase() !== subject.charAt(0)) { | ||
if (!disableSubjectLowerCase && subject.charAt(0).toLowerCase() !== subject.charAt(0)) { | ||
subject = | ||
@@ -103,3 +103,3 @@ subject.charAt(0).toLowerCase() + subject.slice(1, subject.length); | ||
validate: function(subject, answers) { | ||
var filteredSubject = filterSubject(subject); | ||
var filteredSubject = filterSubject(subject, options.disableSubjectLowerCase); | ||
return filteredSubject.length == 0 | ||
@@ -116,3 +116,3 @@ ? 'subject is required' | ||
transformer: function(subject, answers) { | ||
var filteredSubject = filterSubject(subject); | ||
var filteredSubject = filterSubject(subject, options.disableSubjectLowerCase); | ||
var color = | ||
@@ -125,3 +125,3 @@ filteredSubject.length <= maxSummaryLength(options, answers) | ||
filter: function(subject) { | ||
return filterSubject(subject); | ||
return filterSubject(subject, options.disableSubjectLowerCase); | ||
} | ||
@@ -128,0 +128,0 @@ }, |
@@ -104,2 +104,19 @@ var chai = require('chai'); | ||
}); | ||
it('header and body w/ uppercase subject', function() { | ||
var upperCaseSubject = subject.toLocaleUpperCase(); | ||
expect( | ||
commitMessage( | ||
{ | ||
type, | ||
scope, | ||
subject: upperCaseSubject, | ||
body | ||
}, | ||
{ | ||
...defaultOptions, | ||
disableSubjectLowerCase: true | ||
} | ||
) | ||
).to.equal(`${type}(${scope}): ${upperCaseSubject}\n\n${body}`); | ||
}); | ||
it('header, body and issues w/ out scope', function() { | ||
@@ -321,2 +338,5 @@ expect( | ||
}); | ||
it('disableSubjectLowerCase default', function() { | ||
expect(questionDefault('disableSubjectLowerCase')).to.be.undefined; | ||
}); | ||
}); | ||
@@ -323,0 +343,0 @@ |
@@ -17,2 +17,4 @@ 'format cjs'; | ||
process.env.DISABLE_SCOPE_LOWERCASE || config.disableScopeLowerCase, | ||
disableSubjectLowerCase: | ||
process.env.DISABLE_SUBJECT_LOWERCASE || config.disableSubjectLowerCase, | ||
maxHeaderWidth: | ||
@@ -19,0 +21,0 @@ (process.env.CZ_MAX_HEADER_WIDTH && |
{ | ||
"name": "cz-conventional-changelog", | ||
"version": "3.2.1", | ||
"version": "3.3.0", | ||
"description": "Commitizen adapter following the conventional-changelog format.", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -24,2 +24,4 @@ # cz-conventional-changelog | ||
"path": "./node_modules/cz-conventional-changelog", | ||
"disableScopeLowerCase": false, | ||
"disableSubjectLowerCase": false, | ||
"maxHeaderWidth": 100, | ||
@@ -45,2 +47,3 @@ "maxLineWidth": 100, | ||
``` | ||
### Environment variables | ||
@@ -60,2 +63,1 @@ | ||
If using the [commitlint](https://github.com/conventional-changelog/commitlint) js library, the "maxHeaderWidth" configuration property will default to the configuration of the "header-max-length" rule instead of the hard coded value of 100. This can be ovewritten by setting the 'maxHeaderWidth' configuration in package.json or the CZ_MAX_HEADER_WIDTH environment variable. | ||
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
30365
838
61
14