hive-forge: drop boilerplate # Errors from pure-GET verbs (mara on #827, option A)

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.
This commit is contained in:
damocles 2026-05-31 16:19:25 +02:00 committed by mara
commit d59bfb899f
17 changed files with 0 additions and 87 deletions

View file

@ -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))?;

View file

@ -12,11 +12,6 @@ pub struct Args {
pattern: Option<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();
let v = client.get_json(&format!("/repos/{repo}/branches?limit=100"))?;

View file

@ -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(

View file

@ -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))?;

View file

@ -45,11 +45,6 @@ pub struct Args {
tail: Option<usize>,
}
/// # 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 {

View file

@ -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")?;

View file

@ -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))?;

View file

@ -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) {

View file

@ -116,13 +116,6 @@ struct AssignmentsArgs {
user: Option<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. 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),

View file

@ -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!(

View file

@ -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) {

View file

@ -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))?;

View file

@ -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))?;

View file

@ -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 {

View file

@ -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!(

View file

@ -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

View file

@ -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))?;