merge-ready 0.2.0

Show pull request merge blockers as concise prompt tokens
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
use super::error::RepositoryError;

/// PR のライフサイクル状態(外部コマンドの文字列表現に非依存)
pub enum PrLifecycle {
    Open,
    NotOpen,
}

#[must_use]
pub fn is_open(lifecycle: &PrLifecycle) -> bool {
    matches!(lifecycle, PrLifecycle::Open)
}

pub trait PrStateRepository {
    /// # Errors
    /// Returns `RepositoryError` if the PR lifecycle cannot be fetched.
    fn fetch_lifecycle(&self) -> Result<PrLifecycle, RepositoryError>;
}