…to allow disabling various changelog segments like clippy, or commit statistics. Note that it's always possible to delete individual sections afterwards.
Unified · Split
| @@ -4,9 +4,8 @@ use cargo_metadata::{ · 3 unmodified lines | ||
| 4 | 4 | }; |
| 5 | 5 | use git_repository as git; |
| 6 | 6 | |
| 7 | −use crate::changelog::section::segment; | |
| 8 | 7 | use crate::{ |
| 9 | − changelog::Section, | |
| 8 | + changelog::{section::segment, Section}, | |
| 10 | 9 | commit, |
| 11 | 10 | utils::{package_by_name, will}, |
| 12 | 11 | ChangeLog, |
| @@ -118,10 +118,9 @@ mod from_history { · 117 unmodified lines | ||
| 118 | 118 | use git_repository::prelude::ObjectIdExt; |
| 119 | 119 | use time::OffsetDateTime; |
| 120 | 120 | |
| 121 | − use crate::changelog::section::segment::Selection; | |
| 122 | 121 | use crate::{ |
| 123 | 122 | changelog, |
| 124 | − changelog::{section, Section}, | |
| 123 | + changelog::{section, section::segment::Selection, Section}, | |
| 125 | 124 | commit, utils, |
| 126 | 125 | utils::is_top_level_package, |
| 127 | 126 | }; |
| @@ -36,6 +36,7 @@ fn main() -> anyhow::Result<()> { · 35 unmodified lines | ||
| 36 | 36 | no_publish, |
| 37 | 37 | no_tag, |
| 38 | 38 | no_push, |
| 39 | + changelog_without, | |
| 39 | 40 | dangerously_pass_no_verify, |
| 40 | 41 | no_auto_publish_of_stable_crates, |
| 41 | 42 | no_conservative_pre_release_version_handling, |
| @@ -67,6 +68,7 @@ fn main() -> anyhow::Result<()> { · 25 unmodified lines | ||
| 67 | 68 | allow_auto_publish_of_stable_crates: !no_auto_publish_of_stable_crates, |
| 68 | 69 | update_crates_index, |
| 69 | 70 | preview: !no_changelog_preview, |
| 71 | + generator_segments: names_to_segment_selection(&changelog_without)?, | |
| 70 | 72 | }, |
| 71 | 73 | crates, |
| 72 | 74 | bump.unwrap_or_else(|| "keep".into()), |
| @@ -90,6 +90,10 @@ pub struct SmartRelease { · 89 unmodified lines | ||
| 90 | 90 | #[argh(switch)] |
| 91 | 91 | pub no_changelog: bool, |
| 92 | 92 | |
| 93 | + /// omits these kinds of generated changelog content, values are 'clippy', 'commit-statistics' and 'commit-details' | |
| 94 | + #[argh(option)] | |
| 95 | + pub changelog_without: Vec<String>, | |
| 96 | + | |
| 93 | 97 | /// if unset, about-to-be changed changelogs will be previewed using 'bat', if available. |
| 94 | 98 | /// |
| 95 | 99 | /// If set, no preview will ever be displayed, but note that empty changelogs will always stop the release process. |
| @@ -1,4 +1,6 @@ | ||
| 1 | 1 | pub mod release { |
| 2 | + use crate::changelog::section::segment; | |
| 3 | + | |
| 2 | 4 | #[derive(Debug, Clone, Copy)] |
| 3 | 5 | pub struct Options { |
| 4 | 6 | pub dry_run: bool, |
| @@ -20,6 +22,7 @@ pub mod release { · 15 unmodified lines | ||
| 20 | 22 | pub isolate_dependencies_from_breaking_changes: bool, |
| 21 | 23 | pub changelog: bool, |
| 22 | 24 | pub preview: bool, |
| 25 | + pub generator_segments: segment::Selection, | |
| 23 | 26 | } |
| 24 | 27 | } |
| 25 | 28 | #[path = "release/mod.rs"] |
| @@ -5,7 +5,6 @@ use cargo_metadata::{camino::Utf8PathBuf, Metadata, Package}; · 4 unmodified lines | ||
| 5 | 5 | use semver::{Op, Version, VersionReq}; |
| 6 | 6 | |
| 7 | 7 | use super::{cargo, git, version, Context, Oid, Options}; |
| 8 | −use crate::changelog::section::segment; | |
| 9 | 8 | use crate::{ |
| 10 | 9 | changelog, |
| 11 | 10 | utils::{names_and_versions, package_by_id, package_eq_dependency, will}, |
| @@ -42,7 +41,7 @@ pub(in crate::command::release_impl) fn edit_version_and_fixup_dependent_crates_ · 30 unmodified lines | ||
| 42 | 41 | history, |
| 43 | 42 | &ctx.base, |
| 44 | 43 | opts.dry_run, |
| 45 | − segment::Selection::all(), | |
| 44 | + opts.generator_segments, | |
| 46 | 45 | )?; |
| 47 | 46 | let recent_release_in_log = log.most_recent_release_mut(); |
| 48 | 47 | let new_version: semver::Version = new_version.parse()?; |