From 1195bfbe11d6c676fb3fb4388db767a3128af539 Mon Sep 17 00:00:00 2001 From: damocles Date: Sun, 31 May 2026 15:57:19 +0200 Subject: [PATCH 1/2] hive-forge: add # Errors docs on every verb's pub fn run (closes #816) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit systemic gap argus flagged on PR #798 (timeline verb). every `pub fn run` in hive-forge/src/verbs/*.rs lacked a `# Errors` block — violates Rust API guidelines + obscures the failure surface for operators reading the source. uniform doc per verb category: - pure GET + print verbs: "transport error from the Forgejo REST call + I/O error from stdout" - body-from-file verbs (comment/comment_edit/issue_create/issue_edit/ pr_create): adds 'I/O error from --body-file/stdin input' - file-upload verbs (attach-issue, attach-comment): adds 'file read/exist check' - pr_create: also mentions the --push shellout 23 `pub fn run` signatures touched. no behaviour change; pure documentation sweep. cargo test green (38 tests). --- hive-forge/src/verbs/assign.rs | 5 +++++ hive-forge/src/verbs/attach.rs | 12 ++++++++++++ hive-forge/src/verbs/branches.rs | 5 +++++ hive-forge/src/verbs/close.rs | 5 +++++ hive-forge/src/verbs/comment.rs | 6 ++++++ hive-forge/src/verbs/comment_edit.rs | 6 ++++++ hive-forge/src/verbs/comment_show.rs | 5 +++++ hive-forge/src/verbs/comments.rs | 5 +++++ hive-forge/src/verbs/diff.rs | 5 +++++ hive-forge/src/verbs/issue.rs | 5 +++++ hive-forge/src/verbs/issue_create.rs | 6 ++++++ hive-forge/src/verbs/issue_edit.rs | 6 ++++++ hive-forge/src/verbs/labels.rs | 5 +++++ hive-forge/src/verbs/lint.rs | 7 +++++++ hive-forge/src/verbs/list.rs | 5 +++++ hive-forge/src/verbs/milestone.rs | 5 +++++ hive-forge/src/verbs/pr.rs | 5 +++++ hive-forge/src/verbs/pr_create.rs | 7 +++++++ hive-forge/src/verbs/pr_reviews.rs | 5 +++++ hive-forge/src/verbs/subscription.rs | 5 +++++ hive-forge/src/verbs/timeline.rs | 5 +++++ hive-forge/src/verbs/tree_sha.rs | 5 +++++ hive-forge/src/verbs/view.rs | 5 +++++ 23 files changed, 130 insertions(+) diff --git a/hive-forge/src/verbs/assign.rs b/hive-forge/src/verbs/assign.rs index 5c9ed7136..8b7044dbc 100644 --- a/hive-forge/src/verbs/assign.rs +++ b/hive-forge/src/verbs/assign.rs @@ -21,6 +21,11 @@ pub struct Args { remove: bool, } +/// # Errors +/// +/// Propagates any transport error from the Forgejo REST call +/// (network unreachable, 4xx/5xx response, token missing/invalid) +/// and any I/O error from writing the response to stdout. pub fn run(client: &Client, args: Args) -> Result<()> { let repo = client.repo(); let current = client.get_json(&format!("/repos/{repo}/issues/{}", args.number))?; diff --git a/hive-forge/src/verbs/attach.rs b/hive-forge/src/verbs/attach.rs index 91e621baf..a7d60eee3 100644 --- a/hive-forge/src/verbs/attach.rs +++ b/hive-forge/src/verbs/attach.rs @@ -26,6 +26,12 @@ pub struct CommentArgs { file: PathBuf, } +/// # Errors +/// +/// Returns an error if the input file doesn't exist or can't be +/// read. Propagates any transport error from the Forgejo REST call +/// (network unreachable, 4xx/5xx response, token missing/invalid) +/// and any I/O error from writing the browser download URL to stdout. pub fn run_issue(client: &Client, args: IssueArgs) -> Result<()> { if !args.file.is_file() { bail!( @@ -42,6 +48,12 @@ pub fn run_issue(client: &Client, args: IssueArgs) -> Result<()> { Ok(()) } +/// # Errors +/// +/// Returns an error if the input file doesn't exist or can't be +/// read. Propagates any transport error from the Forgejo REST call +/// (network unreachable, 4xx/5xx response, token missing/invalid) +/// and any I/O error from writing the browser download URL to stdout. pub fn run_comment(client: &Client, args: CommentArgs) -> Result<()> { if !args.file.is_file() { bail!( diff --git a/hive-forge/src/verbs/branches.rs b/hive-forge/src/verbs/branches.rs index 287f50248..8f590faeb 100644 --- a/hive-forge/src/verbs/branches.rs +++ b/hive-forge/src/verbs/branches.rs @@ -12,6 +12,11 @@ pub struct Args { pattern: Option, } +/// # Errors +/// +/// Propagates any transport error from the Forgejo REST call +/// (network unreachable, 4xx/5xx response, token missing/invalid) +/// and any I/O error from writing the response to stdout. pub fn run(client: &Client, args: Args) -> Result<()> { let repo = client.repo(); let v = client.get_json(&format!("/repos/{repo}/branches?limit=100"))?; diff --git a/hive-forge/src/verbs/close.rs b/hive-forge/src/verbs/close.rs index 0d01ce271..58fb2037a 100644 --- a/hive-forge/src/verbs/close.rs +++ b/hive-forge/src/verbs/close.rs @@ -13,6 +13,11 @@ pub struct Args { number: u64, } +/// # Errors +/// +/// Propagates any transport error from the Forgejo REST call +/// (network unreachable, 4xx/5xx response, token missing/invalid) +/// and any I/O error from writing the response to stdout. pub fn run(client: &Client, args: Args) -> Result<()> { let repo = client.repo(); let resp = client.patch_json( diff --git a/hive-forge/src/verbs/comment.rs b/hive-forge/src/verbs/comment.rs index e2aece1af..2a99a380a 100644 --- a/hive-forge/src/verbs/comment.rs +++ b/hive-forge/src/verbs/comment.rs @@ -21,6 +21,12 @@ pub struct Args { body_file: Option, } +/// # Errors +/// +/// Propagates any I/O error from the body input (`--body-file`, +/// stdin), any transport error from the Forgejo REST call (network +/// unreachable, 4xx/5xx response, token missing/invalid), and any +/// I/O error from writing the response to stdout. pub fn run(client: &Client, args: Args) -> Result<()> { let body = body::resolve_required(args.body.as_deref(), args.body_file.as_deref(), "comment")?; let repo = client.repo(); diff --git a/hive-forge/src/verbs/comment_edit.rs b/hive-forge/src/verbs/comment_edit.rs index c271a3997..a2c9aaaf2 100644 --- a/hive-forge/src/verbs/comment_edit.rs +++ b/hive-forge/src/verbs/comment_edit.rs @@ -21,6 +21,12 @@ pub struct Args { body_file: Option, } +/// # Errors +/// +/// Propagates any I/O error from the body input (`--body-file`, +/// stdin), any transport error from the Forgejo REST call (network +/// unreachable, 4xx/5xx response, token missing/invalid), and any +/// I/O error from writing the response to stdout. pub fn run(client: &Client, args: Args) -> Result<()> { let body = body::resolve_required( args.body.as_deref(), diff --git a/hive-forge/src/verbs/comment_show.rs b/hive-forge/src/verbs/comment_show.rs index 65e6e8bbe..a45ea2e4f 100644 --- a/hive-forge/src/verbs/comment_show.rs +++ b/hive-forge/src/verbs/comment_show.rs @@ -14,6 +14,11 @@ pub struct Args { id: u64, } +/// # Errors +/// +/// Propagates any transport error from the Forgejo REST call +/// (network unreachable, 4xx/5xx response, token missing/invalid) +/// and any I/O error from writing the response to stdout. pub fn run(client: &Client, args: Args) -> Result<()> { let repo = client.repo(); let v = client.get_json(&format!("/repos/{repo}/issues/comments/{}", args.id))?; diff --git a/hive-forge/src/verbs/comments.rs b/hive-forge/src/verbs/comments.rs index f27e3047d..24eff13dc 100644 --- a/hive-forge/src/verbs/comments.rs +++ b/hive-forge/src/verbs/comments.rs @@ -45,6 +45,11 @@ pub struct Args { tail: Option, } +/// # Errors +/// +/// Propagates any transport error from the Forgejo REST call +/// (network unreachable, 4xx/5xx response, token missing/invalid) +/// and any I/O error from writing the response to stdout. pub fn run(client: &Client, args: Args) -> Result<()> { let repo = client.repo(); let comments = match args.tail { diff --git a/hive-forge/src/verbs/diff.rs b/hive-forge/src/verbs/diff.rs index 066e0dfc5..8b72ffe0a 100644 --- a/hive-forge/src/verbs/diff.rs +++ b/hive-forge/src/verbs/diff.rs @@ -30,6 +30,11 @@ pub struct Args { full: bool, } +/// # Errors +/// +/// Propagates any transport error from the Forgejo REST call +/// (network unreachable, 4xx/5xx response, token missing/invalid) +/// and any I/O error from writing the response to stdout. pub fn run(client: &Client, args: Args) -> Result<()> { let repo = client.repo(); let diff = client.get_text(&format!("/repos/{repo}/pulls/{}.diff", args.number), "text/plain")?; diff --git a/hive-forge/src/verbs/issue.rs b/hive-forge/src/verbs/issue.rs index fdca71dba..905ab817a 100644 --- a/hive-forge/src/verbs/issue.rs +++ b/hive-forge/src/verbs/issue.rs @@ -13,6 +13,11 @@ pub struct Args { number: u64, } +/// # Errors +/// +/// Propagates any transport error from the Forgejo REST call +/// (network unreachable, 4xx/5xx response, token missing/invalid) +/// and any I/O error from writing the response to stdout. pub fn run(client: &Client, args: Args) -> Result<()> { let repo = client.repo(); let v = client.get_json(&format!("/repos/{repo}/issues/{}", args.number))?; diff --git a/hive-forge/src/verbs/issue_create.rs b/hive-forge/src/verbs/issue_create.rs index b80fc027a..e785bd0dc 100644 --- a/hive-forge/src/verbs/issue_create.rs +++ b/hive-forge/src/verbs/issue_create.rs @@ -24,6 +24,12 @@ pub struct Args { assignee: Option, } +/// # Errors +/// +/// Propagates any I/O error from the body input (`--body-file`, +/// stdin), any transport error from the Forgejo REST call (network +/// unreachable, 4xx/5xx response, token missing/invalid), and any +/// I/O error from writing the issue URL to stdout. pub fn run(client: &Client, args: Args) -> Result<()> { let body = body::resolve(args.body.as_deref(), args.body_file.as_deref())?.unwrap_or_default(); let repo = client.repo(); diff --git a/hive-forge/src/verbs/issue_edit.rs b/hive-forge/src/verbs/issue_edit.rs index ac7616241..9a8911996 100644 --- a/hive-forge/src/verbs/issue_edit.rs +++ b/hive-forge/src/verbs/issue_edit.rs @@ -46,6 +46,12 @@ pub struct Args { milestone: Option, } +/// # Errors +/// +/// Propagates any I/O error from the body input (`--body-file`, +/// stdin), any transport error from the Forgejo REST call (network +/// unreachable, 4xx/5xx response, token missing/invalid), and any +/// I/O error from writing the response to stdout. pub fn run(client: &Client, args: Args) -> Result<()> { // Body is partial: only update the body field if a source was // actually given. Piped stdin without --body/--body-file leaves diff --git a/hive-forge/src/verbs/labels.rs b/hive-forge/src/verbs/labels.rs index a03467501..da03212d9 100644 --- a/hive-forge/src/verbs/labels.rs +++ b/hive-forge/src/verbs/labels.rs @@ -32,6 +32,11 @@ enum Action { }, } +/// # Errors +/// +/// Propagates any transport error from the Forgejo REST call +/// (network unreachable, 4xx/5xx response, token missing/invalid) +/// and any I/O error from writing the response to stdout. pub fn run(client: &Client, args: Args) -> Result<()> { let repo = client.repo(); match args.action.unwrap_or(Action::List) { diff --git a/hive-forge/src/verbs/lint.rs b/hive-forge/src/verbs/lint.rs index af24ffac2..b2ed399cb 100644 --- a/hive-forge/src/verbs/lint.rs +++ b/hive-forge/src/verbs/lint.rs @@ -116,6 +116,13 @@ struct AssignmentsArgs { user: Option, } +/// # Errors +/// +/// Propagates any transport error from the Forgejo REST call +/// (network unreachable, 4xx/5xx response, token missing/invalid) +/// and any I/O error from writing the response to stdout. Subcommand +/// dispatches go through the same per-query helpers and inherit +/// the same surfaces. pub fn run(client: &Client, args: Args) -> Result<()> { match args.sub { Sub::Unassigned(a) => run_unassigned(client, a), diff --git a/hive-forge/src/verbs/list.rs b/hive-forge/src/verbs/list.rs index 605858f93..0f96053bd 100644 --- a/hive-forge/src/verbs/list.rs +++ b/hive-forge/src/verbs/list.rs @@ -86,6 +86,11 @@ pub struct Args { limit: u64, } +/// # Errors +/// +/// Propagates any transport error from the Forgejo REST call +/// (network unreachable, 4xx/5xx response, token missing/invalid) +/// and any I/O error from writing the response to stdout. pub fn run(client: &Client, args: Args) -> Result<()> { let repo = client.repo(); let mut path = format!( diff --git a/hive-forge/src/verbs/milestone.rs b/hive-forge/src/verbs/milestone.rs index 5ce9000a4..b476b7114 100644 --- a/hive-forge/src/verbs/milestone.rs +++ b/hive-forge/src/verbs/milestone.rs @@ -37,6 +37,11 @@ enum Action { }, } +/// # Errors +/// +/// Propagates any transport error from the Forgejo REST call +/// (network unreachable, 4xx/5xx response, token missing/invalid) +/// and any I/O error from writing the response to stdout. pub fn run(client: &Client, args: Args) -> Result<()> { let repo = client.repo(); match args.action.unwrap_or(Action::List) { diff --git a/hive-forge/src/verbs/pr.rs b/hive-forge/src/verbs/pr.rs index a3e101af6..282041f6f 100644 --- a/hive-forge/src/verbs/pr.rs +++ b/hive-forge/src/verbs/pr.rs @@ -13,6 +13,11 @@ pub struct Args { number: u64, } +/// # Errors +/// +/// Propagates any transport error from the Forgejo REST call +/// (network unreachable, 4xx/5xx response, token missing/invalid) +/// and any I/O error from writing the response to stdout. pub fn run(client: &Client, args: Args) -> Result<()> { let repo = client.repo(); let v = client.get_json(&format!("/repos/{repo}/pulls/{}", args.number))?; diff --git a/hive-forge/src/verbs/pr_create.rs b/hive-forge/src/verbs/pr_create.rs index 3449ac9ee..92d1376f7 100644 --- a/hive-forge/src/verbs/pr_create.rs +++ b/hive-forge/src/verbs/pr_create.rs @@ -51,6 +51,13 @@ pub struct Args { remote: String, } +/// # Errors +/// +/// Propagates any I/O error from the body input (`--body-file`, +/// stdin) or the `--push` shellout to git, any transport error from +/// the Forgejo REST call (network unreachable, 4xx/5xx response, +/// token missing/invalid), and any I/O error from writing the PR +/// URL to stdout. pub fn run(client: &Client, args: Args) -> Result<()> { let body = body::resolve(args.body.as_deref(), args.body_file.as_deref())?.unwrap_or_default(); if args.push { diff --git a/hive-forge/src/verbs/pr_reviews.rs b/hive-forge/src/verbs/pr_reviews.rs index dbf957727..cb9f83878 100644 --- a/hive-forge/src/verbs/pr_reviews.rs +++ b/hive-forge/src/verbs/pr_reviews.rs @@ -13,6 +13,11 @@ pub struct Args { number: u64, } +/// # Errors +/// +/// Propagates any transport error from the Forgejo REST call +/// (network unreachable, 4xx/5xx response, token missing/invalid) +/// and any I/O error from writing the response to stdout. pub fn run(client: &Client, args: Args) -> Result<()> { let repo = client.repo(); let v = client.get_json(&format!("/repos/{repo}/pulls/{}/reviews", args.number))?; diff --git a/hive-forge/src/verbs/subscription.rs b/hive-forge/src/verbs/subscription.rs index 8fc16d63a..08016d133 100644 --- a/hive-forge/src/verbs/subscription.rs +++ b/hive-forge/src/verbs/subscription.rs @@ -21,6 +21,11 @@ pub struct Args { unwatch: bool, } +/// # Errors +/// +/// Propagates any transport error from the Forgejo REST call +/// (network unreachable, 4xx/5xx response, token missing/invalid) +/// and any I/O error from writing the response to stdout. pub fn run(client: &Client, args: Args) -> Result<()> { let repo = client.repo(); if args.unwatch { diff --git a/hive-forge/src/verbs/timeline.rs b/hive-forge/src/verbs/timeline.rs index 52c35f1e9..d29bed53d 100644 --- a/hive-forge/src/verbs/timeline.rs +++ b/hive-forge/src/verbs/timeline.rs @@ -32,6 +32,11 @@ pub struct Args { limit: u64, } +/// # Errors +/// +/// Propagates any transport error from the Forgejo REST call +/// (network unreachable, 4xx/5xx response, token missing/invalid) +/// and any I/O error from writing the response to stdout. pub fn run(client: &Client, args: Args) -> Result<()> { let repo = client.repo(); let v = client.get_json(&format!( diff --git a/hive-forge/src/verbs/tree_sha.rs b/hive-forge/src/verbs/tree_sha.rs index e2599c9dc..29fd98e64 100644 --- a/hive-forge/src/verbs/tree_sha.rs +++ b/hive-forge/src/verbs/tree_sha.rs @@ -13,6 +13,11 @@ pub struct Args { reference: String, } +/// # Errors +/// +/// Propagates any transport error from the Forgejo REST call +/// (network unreachable, 4xx/5xx response, token missing/invalid) +/// and any I/O error from writing the response to stdout. pub fn run(client: &Client, args: Args) -> Result<()> { let repo = client.repo(); // Try branch first; the bash helper silently treats failure as diff --git a/hive-forge/src/verbs/view.rs b/hive-forge/src/verbs/view.rs index 01494cdc8..53e0719c2 100644 --- a/hive-forge/src/verbs/view.rs +++ b/hive-forge/src/verbs/view.rs @@ -13,6 +13,11 @@ pub struct Args { number: u64, } +/// # Errors +/// +/// Propagates any transport error from the Forgejo REST call +/// (network unreachable, 4xx/5xx response, token missing/invalid) +/// and any I/O error from writing the response to stdout. pub fn run(client: &Client, args: Args) -> Result<()> { let repo = client.repo(); let issue = client.get_json(&format!("/repos/{repo}/issues/{}", args.number))?; From d59bfb899f301bdc9053a5376357978a85807335 Mon Sep 17 00:00:00 2001 From: damocles Date: Sun, 31 May 2026 16:19:25 +0200 Subject: [PATCH 2/2] hive-forge: drop boilerplate # Errors from pure-GET verbs (mara on #827, option A) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit mara: 'those comments seem very redundant'. true — the 16 pure-GET verbs all got the same 'transport error + stdout I/O' boilerplate, which just restates the Result<()> contract that's trivially derivable from the type. dropped # Errors from: assign, branches, close, comment_show, comments, diff, issue, labels, lint, list, milestone, pr, pr_reviews, subscription, timeline, tree_sha, view (17 files). kept on the 7 verbs that have a non-Forgejo failure surface worth documenting: - comment, comment_edit, issue_create, issue_edit — body input I/O via --body-file / stdin - pr_create — body input + --push shellout to git - attach::run_issue, attach::run_comment — explicit bail! on missing file net: 23 verbs touched in the original PR → 17 trimmed back to no-doc, 6 kept (with the 7th call being attach::run_comment in the same file). 38 tests still pass. --- hive-forge/src/verbs/assign.rs | 5 ----- hive-forge/src/verbs/branches.rs | 5 ----- hive-forge/src/verbs/close.rs | 5 ----- hive-forge/src/verbs/comment_show.rs | 5 ----- hive-forge/src/verbs/comments.rs | 5 ----- hive-forge/src/verbs/diff.rs | 5 ----- hive-forge/src/verbs/issue.rs | 5 ----- hive-forge/src/verbs/labels.rs | 5 ----- hive-forge/src/verbs/lint.rs | 7 ------- hive-forge/src/verbs/list.rs | 5 ----- hive-forge/src/verbs/milestone.rs | 5 ----- hive-forge/src/verbs/pr.rs | 5 ----- hive-forge/src/verbs/pr_reviews.rs | 5 ----- hive-forge/src/verbs/subscription.rs | 5 ----- hive-forge/src/verbs/timeline.rs | 5 ----- hive-forge/src/verbs/tree_sha.rs | 5 ----- hive-forge/src/verbs/view.rs | 5 ----- 17 files changed, 87 deletions(-) diff --git a/hive-forge/src/verbs/assign.rs b/hive-forge/src/verbs/assign.rs index 8b7044dbc..5c9ed7136 100644 --- a/hive-forge/src/verbs/assign.rs +++ b/hive-forge/src/verbs/assign.rs @@ -21,11 +21,6 @@ pub struct Args { remove: bool, } -/// # Errors -/// -/// Propagates any transport error from the Forgejo REST call -/// (network unreachable, 4xx/5xx response, token missing/invalid) -/// and any I/O error from writing the response to stdout. pub fn run(client: &Client, args: Args) -> Result<()> { let repo = client.repo(); let current = client.get_json(&format!("/repos/{repo}/issues/{}", args.number))?; diff --git a/hive-forge/src/verbs/branches.rs b/hive-forge/src/verbs/branches.rs index 8f590faeb..287f50248 100644 --- a/hive-forge/src/verbs/branches.rs +++ b/hive-forge/src/verbs/branches.rs @@ -12,11 +12,6 @@ pub struct Args { pattern: Option, } -/// # Errors -/// -/// Propagates any transport error from the Forgejo REST call -/// (network unreachable, 4xx/5xx response, token missing/invalid) -/// and any I/O error from writing the response to stdout. pub fn run(client: &Client, args: Args) -> Result<()> { let repo = client.repo(); let v = client.get_json(&format!("/repos/{repo}/branches?limit=100"))?; diff --git a/hive-forge/src/verbs/close.rs b/hive-forge/src/verbs/close.rs index 58fb2037a..0d01ce271 100644 --- a/hive-forge/src/verbs/close.rs +++ b/hive-forge/src/verbs/close.rs @@ -13,11 +13,6 @@ pub struct Args { number: u64, } -/// # Errors -/// -/// Propagates any transport error from the Forgejo REST call -/// (network unreachable, 4xx/5xx response, token missing/invalid) -/// and any I/O error from writing the response to stdout. pub fn run(client: &Client, args: Args) -> Result<()> { let repo = client.repo(); let resp = client.patch_json( diff --git a/hive-forge/src/verbs/comment_show.rs b/hive-forge/src/verbs/comment_show.rs index a45ea2e4f..65e6e8bbe 100644 --- a/hive-forge/src/verbs/comment_show.rs +++ b/hive-forge/src/verbs/comment_show.rs @@ -14,11 +14,6 @@ pub struct Args { id: u64, } -/// # Errors -/// -/// Propagates any transport error from the Forgejo REST call -/// (network unreachable, 4xx/5xx response, token missing/invalid) -/// and any I/O error from writing the response to stdout. pub fn run(client: &Client, args: Args) -> Result<()> { let repo = client.repo(); let v = client.get_json(&format!("/repos/{repo}/issues/comments/{}", args.id))?; diff --git a/hive-forge/src/verbs/comments.rs b/hive-forge/src/verbs/comments.rs index 24eff13dc..f27e3047d 100644 --- a/hive-forge/src/verbs/comments.rs +++ b/hive-forge/src/verbs/comments.rs @@ -45,11 +45,6 @@ pub struct Args { tail: Option, } -/// # Errors -/// -/// Propagates any transport error from the Forgejo REST call -/// (network unreachable, 4xx/5xx response, token missing/invalid) -/// and any I/O error from writing the response to stdout. pub fn run(client: &Client, args: Args) -> Result<()> { let repo = client.repo(); let comments = match args.tail { diff --git a/hive-forge/src/verbs/diff.rs b/hive-forge/src/verbs/diff.rs index 8b72ffe0a..066e0dfc5 100644 --- a/hive-forge/src/verbs/diff.rs +++ b/hive-forge/src/verbs/diff.rs @@ -30,11 +30,6 @@ pub struct Args { full: bool, } -/// # Errors -/// -/// Propagates any transport error from the Forgejo REST call -/// (network unreachable, 4xx/5xx response, token missing/invalid) -/// and any I/O error from writing the response to stdout. pub fn run(client: &Client, args: Args) -> Result<()> { let repo = client.repo(); let diff = client.get_text(&format!("/repos/{repo}/pulls/{}.diff", args.number), "text/plain")?; diff --git a/hive-forge/src/verbs/issue.rs b/hive-forge/src/verbs/issue.rs index 905ab817a..fdca71dba 100644 --- a/hive-forge/src/verbs/issue.rs +++ b/hive-forge/src/verbs/issue.rs @@ -13,11 +13,6 @@ pub struct Args { number: u64, } -/// # Errors -/// -/// Propagates any transport error from the Forgejo REST call -/// (network unreachable, 4xx/5xx response, token missing/invalid) -/// and any I/O error from writing the response to stdout. pub fn run(client: &Client, args: Args) -> Result<()> { let repo = client.repo(); let v = client.get_json(&format!("/repos/{repo}/issues/{}", args.number))?; diff --git a/hive-forge/src/verbs/labels.rs b/hive-forge/src/verbs/labels.rs index da03212d9..a03467501 100644 --- a/hive-forge/src/verbs/labels.rs +++ b/hive-forge/src/verbs/labels.rs @@ -32,11 +32,6 @@ enum Action { }, } -/// # Errors -/// -/// Propagates any transport error from the Forgejo REST call -/// (network unreachable, 4xx/5xx response, token missing/invalid) -/// and any I/O error from writing the response to stdout. pub fn run(client: &Client, args: Args) -> Result<()> { let repo = client.repo(); match args.action.unwrap_or(Action::List) { diff --git a/hive-forge/src/verbs/lint.rs b/hive-forge/src/verbs/lint.rs index b2ed399cb..af24ffac2 100644 --- a/hive-forge/src/verbs/lint.rs +++ b/hive-forge/src/verbs/lint.rs @@ -116,13 +116,6 @@ struct AssignmentsArgs { user: Option, } -/// # Errors -/// -/// Propagates any transport error from the Forgejo REST call -/// (network unreachable, 4xx/5xx response, token missing/invalid) -/// and any I/O error from writing the response to stdout. Subcommand -/// dispatches go through the same per-query helpers and inherit -/// the same surfaces. pub fn run(client: &Client, args: Args) -> Result<()> { match args.sub { Sub::Unassigned(a) => run_unassigned(client, a), diff --git a/hive-forge/src/verbs/list.rs b/hive-forge/src/verbs/list.rs index 0f96053bd..605858f93 100644 --- a/hive-forge/src/verbs/list.rs +++ b/hive-forge/src/verbs/list.rs @@ -86,11 +86,6 @@ pub struct Args { limit: u64, } -/// # Errors -/// -/// Propagates any transport error from the Forgejo REST call -/// (network unreachable, 4xx/5xx response, token missing/invalid) -/// and any I/O error from writing the response to stdout. pub fn run(client: &Client, args: Args) -> Result<()> { let repo = client.repo(); let mut path = format!( diff --git a/hive-forge/src/verbs/milestone.rs b/hive-forge/src/verbs/milestone.rs index b476b7114..5ce9000a4 100644 --- a/hive-forge/src/verbs/milestone.rs +++ b/hive-forge/src/verbs/milestone.rs @@ -37,11 +37,6 @@ enum Action { }, } -/// # Errors -/// -/// Propagates any transport error from the Forgejo REST call -/// (network unreachable, 4xx/5xx response, token missing/invalid) -/// and any I/O error from writing the response to stdout. pub fn run(client: &Client, args: Args) -> Result<()> { let repo = client.repo(); match args.action.unwrap_or(Action::List) { diff --git a/hive-forge/src/verbs/pr.rs b/hive-forge/src/verbs/pr.rs index 282041f6f..a3e101af6 100644 --- a/hive-forge/src/verbs/pr.rs +++ b/hive-forge/src/verbs/pr.rs @@ -13,11 +13,6 @@ pub struct Args { number: u64, } -/// # Errors -/// -/// Propagates any transport error from the Forgejo REST call -/// (network unreachable, 4xx/5xx response, token missing/invalid) -/// and any I/O error from writing the response to stdout. pub fn run(client: &Client, args: Args) -> Result<()> { let repo = client.repo(); let v = client.get_json(&format!("/repos/{repo}/pulls/{}", args.number))?; diff --git a/hive-forge/src/verbs/pr_reviews.rs b/hive-forge/src/verbs/pr_reviews.rs index cb9f83878..dbf957727 100644 --- a/hive-forge/src/verbs/pr_reviews.rs +++ b/hive-forge/src/verbs/pr_reviews.rs @@ -13,11 +13,6 @@ pub struct Args { number: u64, } -/// # Errors -/// -/// Propagates any transport error from the Forgejo REST call -/// (network unreachable, 4xx/5xx response, token missing/invalid) -/// and any I/O error from writing the response to stdout. pub fn run(client: &Client, args: Args) -> Result<()> { let repo = client.repo(); let v = client.get_json(&format!("/repos/{repo}/pulls/{}/reviews", args.number))?; diff --git a/hive-forge/src/verbs/subscription.rs b/hive-forge/src/verbs/subscription.rs index 08016d133..8fc16d63a 100644 --- a/hive-forge/src/verbs/subscription.rs +++ b/hive-forge/src/verbs/subscription.rs @@ -21,11 +21,6 @@ pub struct Args { unwatch: bool, } -/// # Errors -/// -/// Propagates any transport error from the Forgejo REST call -/// (network unreachable, 4xx/5xx response, token missing/invalid) -/// and any I/O error from writing the response to stdout. pub fn run(client: &Client, args: Args) -> Result<()> { let repo = client.repo(); if args.unwatch { diff --git a/hive-forge/src/verbs/timeline.rs b/hive-forge/src/verbs/timeline.rs index d29bed53d..52c35f1e9 100644 --- a/hive-forge/src/verbs/timeline.rs +++ b/hive-forge/src/verbs/timeline.rs @@ -32,11 +32,6 @@ pub struct Args { limit: u64, } -/// # Errors -/// -/// Propagates any transport error from the Forgejo REST call -/// (network unreachable, 4xx/5xx response, token missing/invalid) -/// and any I/O error from writing the response to stdout. pub fn run(client: &Client, args: Args) -> Result<()> { let repo = client.repo(); let v = client.get_json(&format!( diff --git a/hive-forge/src/verbs/tree_sha.rs b/hive-forge/src/verbs/tree_sha.rs index 29fd98e64..e2599c9dc 100644 --- a/hive-forge/src/verbs/tree_sha.rs +++ b/hive-forge/src/verbs/tree_sha.rs @@ -13,11 +13,6 @@ pub struct Args { reference: String, } -/// # Errors -/// -/// Propagates any transport error from the Forgejo REST call -/// (network unreachable, 4xx/5xx response, token missing/invalid) -/// and any I/O error from writing the response to stdout. pub fn run(client: &Client, args: Args) -> Result<()> { let repo = client.repo(); // Try branch first; the bash helper silently treats failure as diff --git a/hive-forge/src/verbs/view.rs b/hive-forge/src/verbs/view.rs index 53e0719c2..01494cdc8 100644 --- a/hive-forge/src/verbs/view.rs +++ b/hive-forge/src/verbs/view.rs @@ -13,11 +13,6 @@ pub struct Args { number: u64, } -/// # Errors -/// -/// Propagates any transport error from the Forgejo REST call -/// (network unreachable, 4xx/5xx response, token missing/invalid) -/// and any I/O error from writing the response to stdout. pub fn run(client: &Client, args: Args) -> Result<()> { let repo = client.repo(); let issue = client.get_json(&format!("/repos/{repo}/issues/{}", args.number))?;