feat: add interactive conventional commit workflow with jj-lib backend
Replace CLI executor with jj-lib integration, implement full interactive commit workflow via prompts, and add mock infrastructure for testing. Add CLI integration tests and error handling tests.
This commit is contained in:
32
src/error.rs
32
src/error.rs
@@ -1,6 +1,6 @@
|
||||
use crate::commit::types::{CommitMessageError, DescriptionError, ScopeError};
|
||||
|
||||
#[derive(Debug, thiserror::Error)]
|
||||
#[derive(Debug, Clone, PartialEq, Eq, thiserror::Error)]
|
||||
pub enum Error {
|
||||
// Domain errors
|
||||
#[error("Invalid scope: {0}")]
|
||||
@@ -50,33 +50,3 @@ impl From<std::io::Error> for Error {
|
||||
Self::FailedGettingCurrentDir
|
||||
}
|
||||
}
|
||||
|
||||
impl From<jj_lib::config::ConfigGetError> for Error {
|
||||
fn from(_: jj_lib::config::ConfigGetError) -> Self {
|
||||
Self::FailedReadingConfig
|
||||
}
|
||||
}
|
||||
|
||||
impl From<jj_lib::repo::RepoLoaderError> for Error {
|
||||
fn from(error: jj_lib::repo::RepoLoaderError) -> Self {
|
||||
Self::JjOperation {
|
||||
context: format!("Failed to load repository: {}", error),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl From<jj_lib::backend::BackendError> for Error {
|
||||
fn from(error: jj_lib::backend::BackendError) -> Self {
|
||||
Self::JjOperation {
|
||||
context: format!("Backend operation failed: {}", error),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl From<jj_lib::transaction::TransactionCommitError> for Error {
|
||||
fn from(error: jj_lib::transaction::TransactionCommitError) -> Self {
|
||||
Self::JjOperation {
|
||||
context: format!("Transaction commit failed: {}", error),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user