Skip to content

Commit 46eb517

Browse files
test(CHANGELOG): add --allow-released-changes to cargo xtask changelog
1 parent 6b9a08e commit 46eb517

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

xtask/src/changelog.rs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ use xshell::Shell;
66

77
pub(crate) fn check_changelog(shell: Shell, mut args: Arguments) -> anyhow::Result<()> {
88
const CHANGELOG_PATH_RELATIVE: &str = "./CHANGELOG.md";
9+
let allow_released_changes = args.contains("--allow-released-changes");
910

1011
let from_branch = args
1112
.free_from_str()
@@ -72,7 +73,12 @@ pub(crate) fn check_changelog(shell: Shell, mut args: Arguments) -> anyhow::Resu
7273
"one or more checks against `{}` failed; see above for details",
7374
CHANGELOG_PATH_RELATIVE,
7475
);
75-
Err(anyhow::Error::msg(msg))
76+
if allow_released_changes {
77+
log::warn!("{msg}");
78+
Ok(())
79+
} else {
80+
Err(anyhow::Error::msg(msg))
81+
}
7682
} else {
7783
Ok(())
7884
}

xtask/src/main.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,8 @@ Commands:
5353
5454
`<to_commit>` is the tip of the `git diff` that will be used for checking (1).
5555
56+
--allow-released-changes Only reports issues as warnings, rather than reporting errors and forcing a non-zero exit code.
57+
5658
miri
5759
Run all miri-compatible tests under miri. Requires a nightly toolchain
5860
with the x86_64-unknown-linux-gnu target and miri component installed.

0 commit comments

Comments
 (0)