From b63a5ffdf540cdaff2013e4465f640ef5a8f5013 Mon Sep 17 00:00:00 2001 From: bravo-kernel Date: Mon, 9 Sep 2019 10:18:36 +0200 Subject: [PATCH] fix(preset, eslint): display short tag in release notes closes #313 --- packages/conventional-changelog-eslint/templates/commit.hbs | 2 +- packages/conventional-changelog-eslint/writer-opts.js | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/conventional-changelog-eslint/templates/commit.hbs b/packages/conventional-changelog-eslint/templates/commit.hbs index abd82a3f3..c84b85f90 100644 --- a/packages/conventional-changelog-eslint/templates/commit.hbs +++ b/packages/conventional-changelog-eslint/templates/commit.hbs @@ -1,5 +1,5 @@ * {{#if message}}{{message}}{{else}}{{header}}{{/if}} -{{~!-- commit hash --}} {{#if @root.linkReferences}}([{{hash}}]({{#if @root.host}}{{@root.host}}/{{/if}}{{#if @root.owner}}{{@root.owner}}/{{/if}}{{@root.repository}}/{{@root.commit}}/{{hash}})){{else}}{{hash~}}{{/if}} +{{~!-- commit hash --}} {{#if @root.linkReferences}}([{{shortHash}}]({{#if @root.host}}{{@root.host}}/{{/if}}{{#if @root.owner}}{{@root.owner}}/{{/if}}{{@root.repository}}/{{@root.commit}}/{{hash}})){{else}}{{hash~}}{{/if}} {{~!-- commit references --}}{{#if references}}, closes{{~#each references}} {{#if @root.linkReferences}}[{{#if this.owner}}{{this.owner}}/{{/if}}{{this.repository}}#{{this.issue}}]({{#if @root.host}}{{@root.host}}/{{/if}}{{#if this.repository}}{{#if this.owner}}{{this.owner}}/{{/if}}{{this.repository}}{{else}}{{#if @root.owner}}{{@root.owner}}/{{/if}}{{@root.repository}}{{/if}}/{{@root.issue}}/{{this.issue}}){{else}}{{#if this.owner}}{{this.owner}}/{{/if}}{{this.repository}}#{{this.issue}}{{/if}}{{/each}}{{/if}} diff --git a/packages/conventional-changelog-eslint/writer-opts.js b/packages/conventional-changelog-eslint/writer-opts.js index 949b89f4c..db3d871fe 100644 --- a/packages/conventional-changelog-eslint/writer-opts.js +++ b/packages/conventional-changelog-eslint/writer-opts.js @@ -26,6 +26,8 @@ function getWriterOpts () { return } + commit.shortHash = commit.hash.substring(0, 7) + return commit }, groupBy: `tag`,