Skip to content

Commit

Permalink
chore(package): update xo to version 0.24.0
Browse files Browse the repository at this point in the history
  • Loading branch information
greenkeeper[bot] authored and pvdlg committed Oct 14, 2019
1 parent 57ff2a4 commit 20fdb01
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 1 deletion.
6 changes: 6 additions & 0 deletions lib/commit-groups-compare.js
Expand Up @@ -16,20 +16,26 @@ module.exports = (group1, group2) => {
if (idx1 !== -1 && idx2 === -1) {
return -1;
}

if (idx1 === -1 && idx2 !== -1) {
return 1;
}

if (idx1 < idx2) {
return -1;
}

if (idx1 > idx2) {
return 1;
}

if (group1.title < group2.title) {
return -1;
}

if (group1.title > group2.title) {
return 1;
}

return 0;
};
5 changes: 5 additions & 0 deletions lib/commit-transform.js
Expand Up @@ -33,6 +33,7 @@ module.exports = (commit, context) => {
if (typeof commit.hash === 'string') {
commit.hash = commit.hash.substring(0, COMMIT_HASH_LENGTH);
}

const references = [];

if (typeof commit.subject === 'string') {
Expand All @@ -46,19 +47,23 @@ module.exports = (commit, context) => {
return `[#${issue}](${url}${issue})`;
});
}

if (context.host) {
// User URLs.
commit.subject = commit.subject.replace(/\B@([a-z0-9](?:-?[a-z0-9]){0,38})/g, `[@$1](${context.host}/$1)`);
}
}

if (commit.references) {
// Remove references that already appear in the subject
commit.references = commit.references.filter(reference => {
if (references.indexOf(reference.issue) === -1) {
return true;
}

return false;
});
}

return commit;
};
2 changes: 1 addition & 1 deletion package.json
Expand Up @@ -25,7 +25,7 @@
"semantic-release": "^15.0.0",
"stringz": "^1.0.0",
"tempy": "^0.2.0",
"xo": "^0.23.0"
"xo": "^0.24.0"
},
"engines": {
"node": ">=6"
Expand Down

0 comments on commit 20fdb01

Please sign in to comment.