Skip to content
This repository has been archived by the owner on Feb 21, 2020. It is now read-only.

Commit

Permalink
fix: case sensitivity (#52)
Browse files Browse the repository at this point in the history
* fix: case insensitive header regex
* fix: case insensitivity for the `increment` plugin

Updates for the zeke/semantic-pull-requests#39 and conventional-commits/conventionalcommits.org#110

Signed-off-by: Charlike Mike Reagent <mameto2011@gmail.com>
  • Loading branch information
Charlike Mike Reagent authored Dec 20, 2018
1 parent e07af5d commit 9301852
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/header.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ export function parseHeader(header) {

// because the last question mark, which we totally need
// eslint-disable-next-line unicorn/no-unsafe-regex
const regex = /^(\w+)(?:\((.+)\))?: (.+)$/;
const regex = /^(\w+)(?:\((.+)\))?: (.+)$/i;
if (!regex.test(header)) {
throw new TypeError(errorMsg);
}
Expand Down
6 changes: 3 additions & 3 deletions src/plugins/increment.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@ export default function increment(commit) {
let isBreaking = isBreakingChange(commit);
let commitIncrement = false;

if (/fix|bugfix|patch/.test(commit.header.type)) {
if (/fix|bugfix|patch/i.test(commit.header.type)) {
commitIncrement = 'patch';
}
if (/feat|feature|minor/.test(commit.header.type)) {
if (/feat|feature|minor/i.test(commit.header.type)) {
commitIncrement = 'minor';
}
if (/break|breaking|major/.test(commit.header.type) || isBreaking) {
if (/break|breaking|major/i.test(commit.header.type) || isBreaking) {
commitIncrement = 'major';
}
isBreaking = isBreaking || commitIncrement === 'major';
Expand Down

0 comments on commit 9301852

Please sign in to comment.