From 41e91a349ee51da6b312a9f2cd6910836c0f7eb0 Mon Sep 17 00:00:00 2001 From: pataar Date: Tue, 19 Oct 2021 19:07:06 +0200 Subject: [PATCH] test: fix newlines of non-scoped commits --- git-cliff-core/tests/integration_test.rs | 45 ++++++++++-------------- 1 file changed, 19 insertions(+), 26 deletions(-) diff --git a/git-cliff-core/tests/integration_test.rs b/git-cliff-core/tests/integration_test.rs index 3152a852c0..00c93ed651 100644 --- a/git-cliff-core/tests/integration_test.rs +++ b/git-cliff-core/tests/integration_test.rs @@ -19,23 +19,16 @@ fn generate_changelog() -> Result<()> { r#" ## Release {{ version }} {% for group, commits in commits | group_by(attribute="group") %} - ### {{ group }} - {% for commit in commits - | filter(attribute="scope") - | sort(attribute="scope") %} - - *({{commit.scope}})* {{ commit.message }} - {%- if commit.breaking %} - {% raw %} {% endraw %}- **BREAKING**: {{commit.breaking_description}} - {%- endif -%} - {%- endfor -%} - {%- for commit in commits %} + ### {{ group }} + {% for commit in commits %} {%- if commit.scope -%} + - *({{commit.scope}})* {{ commit.message }} {% else -%} - - {{ commit.message }} + - {{ commit.message }} + {% endif -%} {% if commit.breaking -%} {% raw %} {% endraw %}- **BREAKING**: {{commit.breaking_description}} {% endif -%} - {% endif -%} {% endfor -%} {% endfor %}"#, ), @@ -138,27 +131,27 @@ fn generate_changelog() -> Result<()> { ## Release v2.0.0 - ### fix bugs - - fix abc - - ### shiny features + ### fix bugs + - fix abc - - *(big-feature)* this is a breaking change + ### shiny features + - add xyz + - add zyx + - *(random-scope)* add random feature + - *(big-feature)* this is a breaking change - **BREAKING**: this is a breaking change - - *(random-scope)* add random feature- add xyz - - add zyx ## Release v1.0.0 - ### chore - - do nothing + ### chore + - do nothing - ### feat - - add cool features + ### feat + - add cool features - ### fix - - fix stuff - - fix more stuff + ### fix + - fix stuff + - fix more stuff eoc - end of changelog\n", out );