feat: enable commit bodies in changelog and fixes general warnings and updates
This commit is contained in:
@@ -6,7 +6,7 @@ readme = "../../README.md"
|
||||
license-file = "../../LICENSE"
|
||||
version = "0.1.0"
|
||||
edition = "2021"
|
||||
publishable = true
|
||||
publish = true
|
||||
|
||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||
|
||||
@@ -15,7 +15,7 @@ anyhow.workspace = true
|
||||
tracing.workspace = true
|
||||
tracing-subscriber.workspace = true
|
||||
clap.workspace = true
|
||||
dotenv.workspace = true
|
||||
dotenvy.workspace = true
|
||||
serde_yaml.workspace = true
|
||||
serde.workspace = true
|
||||
reqwest = { workspace = true, features = ["blocking", "json"] }
|
||||
@@ -29,6 +29,9 @@ chrono.workspace = true
|
||||
lazy_static.workspace = true
|
||||
parse-changelog.workspace = true
|
||||
|
||||
# Cliff depends on 13.1.0, which is a broken release
|
||||
cacache = "=13.0.0"
|
||||
|
||||
[dev-dependencies]
|
||||
tracing-test = { workspace = true, features = ["no-env-filter"] }
|
||||
pretty_assertions.workspace = true
|
||||
|
||||
@@ -3,7 +3,7 @@ use chrono::{DateTime, NaiveDate, Utc};
|
||||
use git_cliff_core::{
|
||||
changelog::Changelog,
|
||||
commit::Commit,
|
||||
config::{Bump, ChangelogConfig, CommitParser, Config, GitConfig, Remote, RemoteConfig},
|
||||
config::{Bump, ChangelogConfig, CommitParser, Config, GitConfig, RemoteConfig},
|
||||
release::Release,
|
||||
};
|
||||
use regex::Regex;
|
||||
@@ -79,6 +79,7 @@ impl ChangeLogBuilder {
|
||||
previous: None,
|
||||
message: None,
|
||||
repository: None,
|
||||
extra: None,
|
||||
},
|
||||
config: self.config,
|
||||
release_link: self.release_link,
|
||||
@@ -225,6 +226,8 @@ fn default_changelog_config(header: Option<String>, release_link: Option<&str>)
|
||||
footer: None,
|
||||
trim: Some(true),
|
||||
postprocessors: None,
|
||||
render_always: None,
|
||||
output: None,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -240,6 +243,11 @@ fn default_changelog_body_config(release_link: Option<&str>) -> String {
|
||||
{% else -%}
|
||||
- {% if commit.breaking %}[**breaking**] {% endif %}{{ commit.message }}
|
||||
{% endif -%}
|
||||
{%- if commit.body -%}
|
||||
{%- if commit.body | length > 0 -%}
|
||||
{% raw %} {% endraw %}{{ commit.body | trim }}
|
||||
{% endif -%}
|
||||
{% endif -%}
|
||||
{% endfor -%}
|
||||
{% endfor %}"#;
|
||||
|
||||
@@ -512,7 +520,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
||||
#[test]
|
||||
fn generates_changelog() {
|
||||
let commits: Vec<&str> = vec = get_commits("second-sha".into()).unwrap();
|
||||
|
||||
assert_eq!(
|
||||
expected.get(0).unwrap().clone().as_slice(),
|
||||
expected.first().unwrap().clone().as_slice(),
|
||||
actual.as_slice()
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
use crate::RemoteGitEngine;
|
||||
|
||||
#[derive(Default)]
|
||||
pub struct LocalGitClient {}
|
||||
|
||||
impl LocalGitClient {
|
||||
|
||||
Reference in New Issue
Block a user