Skip to main content

git_iris/types/
pr.rs

1//! Pull request types and formatting
2//!
3//! This module provides markdown-based PR output that lets the LLM drive
4//! the structure while we beautify it for terminal display.
5
6use crate::types::review::render_markdown_for_terminal;
7use schemars::JsonSchema;
8use serde::{Deserialize, Serialize};
9
10/// Markdown-based pull request that lets the LLM determine structure
11#[derive(Serialize, Deserialize, Debug, Clone, JsonSchema)]
12pub struct MarkdownPullRequest {
13    /// The full markdown content of the PR description
14    pub content: String,
15}
16
17impl MarkdownPullRequest {
18    /// Render the markdown content with terminal styling
19    #[must_use]
20    pub fn format(&self) -> String {
21        render_markdown_for_terminal(&self.content)
22    }
23
24    /// Get the raw markdown content (for GitHub/GitLab, etc.)
25    #[must_use]
26    pub fn raw_content(&self) -> &str {
27        &self.content
28    }
29}