diff --git a/git-cliff-core/tests/integration_test.rs b/git-cliff-core/tests/integration_test.rs index 58b5c9fb93..5fb5da6663 100644 --- a/git-cliff-core/tests/integration_test.rs +++ b/git-cliff-core/tests/integration_test.rs @@ -16,7 +16,7 @@ use std::fmt::Write; fn generate_changelog() -> Result<()> { let changelog_config = ChangelogConfig { header: Some(String::from("this is a changelog")), - body: String::from( + body: Some(String::from( r#" ## Release {{ version }} {% for group, commits in commits | group_by(attribute="group") %} @@ -32,12 +32,12 @@ fn generate_changelog() -> Result<()> { {% endif -%} {% endfor -%} {% endfor %}"#, - ), + )), footer: Some(String::from("eoc - end of changelog")), trim: None, }; let git_config = GitConfig { - conventional_commits: true, + conventional_commits: Some(true), filter_unconventional: Some(true), commit_parsers: Some(vec![ CommitParser { @@ -140,7 +140,7 @@ fn generate_changelog() -> Result<()> { ]; let out = &mut String::new(); - let template = Template::new(changelog_config.body)?; + let template = Template::new(changelog_config.body.unwrap())?; writeln!(out, "{}", changelog_config.header.unwrap()).unwrap(); for release in releases { diff --git a/git-cliff/src/changelog.rs b/git-cliff/src/changelog.rs index c9896cccd3..5651d30095 100644 --- a/git-cliff/src/changelog.rs +++ b/git-cliff/src/changelog.rs @@ -171,7 +171,7 @@ mod test { let config = Config { changelog: ChangelogConfig { header: Some(String::from("# Changelog")), - body: String::from( + body: Some(String::from( r#"{% if version %} ## Release [{{ version }}] - {{ timestamp | date(format="%Y-%m-%d") }} ({{ commit_id }}){% else %} @@ -181,12 +181,12 @@ mod test { #### {{ group }}{% for commit in commits %} - {{ commit.message }}{% endfor %} {% endfor %}{% endfor %}"#, - ), + )), footer: Some(String::from("------------")), trim: Some(true), }, git: GitConfig { - conventional_commits: true, + conventional_commits: Some(true), filter_unconventional: Some(false), commit_parsers: Some(vec![ CommitParser {