From 1b8f92ebaf99f65b823cf6ba3e67c611d85c2367 Mon Sep 17 00:00:00 2001 From: Ed Page Date: Wed, 18 Dec 2024 09:02:38 -0600 Subject: [PATCH] refactor(check): Pull out fixup prefix --- crates/committed/src/checks.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/crates/committed/src/checks.rs b/crates/committed/src/checks.rs index c7ee999..9b426b8 100644 --- a/crates/committed/src/checks.rs +++ b/crates/committed/src/checks.rs @@ -348,7 +348,7 @@ pub(crate) fn check_fixup( message: &str, report: report::Report, ) -> Result { - if message.starts_with("fixup! ") { + if message.starts_with(FIXUP_PREFIX) { report(report::Message::error(source, report::Fixup {})); Ok(true) } else { @@ -356,6 +356,8 @@ pub(crate) fn check_fixup( } } +const FIXUP_PREFIX: &str = "fixup! "; + pub(crate) fn check_merge_commit( source: report::Source<'_>, commit: &git2::Commit<'_>,