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:
parent
1195bfbe11
commit
d59bfb899f
17 changed files with 0 additions and 87 deletions
|
|
@ -21,11 +21,6 @@ pub struct Args {
|
||||||
remove: bool,
|
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<()> {
|
pub fn run(client: &Client, args: Args) -> Result<()> {
|
||||||
let repo = client.repo();
|
let repo = client.repo();
|
||||||
let current = client.get_json(&format!("/repos/{repo}/issues/{}", args.number))?;
|
let current = client.get_json(&format!("/repos/{repo}/issues/{}", args.number))?;
|
||||||
|
|
|
||||||
|
|
@ -12,11 +12,6 @@ pub struct Args {
|
||||||
pattern: Option<String>,
|
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<()> {
|
pub fn run(client: &Client, args: Args) -> Result<()> {
|
||||||
let repo = client.repo();
|
let repo = client.repo();
|
||||||
let v = client.get_json(&format!("/repos/{repo}/branches?limit=100"))?;
|
let v = client.get_json(&format!("/repos/{repo}/branches?limit=100"))?;
|
||||||
|
|
|
||||||
|
|
@ -13,11 +13,6 @@ pub struct Args {
|
||||||
number: u64,
|
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<()> {
|
pub fn run(client: &Client, args: Args) -> Result<()> {
|
||||||
let repo = client.repo();
|
let repo = client.repo();
|
||||||
let resp = client.patch_json(
|
let resp = client.patch_json(
|
||||||
|
|
|
||||||
|
|
@ -14,11 +14,6 @@ pub struct Args {
|
||||||
id: u64,
|
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<()> {
|
pub fn run(client: &Client, args: Args) -> Result<()> {
|
||||||
let repo = client.repo();
|
let repo = client.repo();
|
||||||
let v = client.get_json(&format!("/repos/{repo}/issues/comments/{}", args.id))?;
|
let v = client.get_json(&format!("/repos/{repo}/issues/comments/{}", args.id))?;
|
||||||
|
|
|
||||||
|
|
@ -45,11 +45,6 @@ pub struct Args {
|
||||||
tail: Option<usize>,
|
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<()> {
|
pub fn run(client: &Client, args: Args) -> Result<()> {
|
||||||
let repo = client.repo();
|
let repo = client.repo();
|
||||||
let comments = match args.tail {
|
let comments = match args.tail {
|
||||||
|
|
|
||||||
|
|
@ -30,11 +30,6 @@ pub struct Args {
|
||||||
full: bool,
|
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<()> {
|
pub fn run(client: &Client, args: Args) -> Result<()> {
|
||||||
let repo = client.repo();
|
let repo = client.repo();
|
||||||
let diff = client.get_text(&format!("/repos/{repo}/pulls/{}.diff", args.number), "text/plain")?;
|
let diff = client.get_text(&format!("/repos/{repo}/pulls/{}.diff", args.number), "text/plain")?;
|
||||||
|
|
|
||||||
|
|
@ -13,11 +13,6 @@ pub struct Args {
|
||||||
number: u64,
|
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<()> {
|
pub fn run(client: &Client, args: Args) -> Result<()> {
|
||||||
let repo = client.repo();
|
let repo = client.repo();
|
||||||
let v = client.get_json(&format!("/repos/{repo}/issues/{}", args.number))?;
|
let v = client.get_json(&format!("/repos/{repo}/issues/{}", args.number))?;
|
||||||
|
|
|
||||||
|
|
@ -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<()> {
|
pub fn run(client: &Client, args: Args) -> Result<()> {
|
||||||
let repo = client.repo();
|
let repo = client.repo();
|
||||||
match args.action.unwrap_or(Action::List) {
|
match args.action.unwrap_or(Action::List) {
|
||||||
|
|
|
||||||
|
|
@ -116,13 +116,6 @@ struct AssignmentsArgs {
|
||||||
user: Option<String>,
|
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<()> {
|
pub fn run(client: &Client, args: Args) -> Result<()> {
|
||||||
match args.sub {
|
match args.sub {
|
||||||
Sub::Unassigned(a) => run_unassigned(client, a),
|
Sub::Unassigned(a) => run_unassigned(client, a),
|
||||||
|
|
|
||||||
|
|
@ -86,11 +86,6 @@ pub struct Args {
|
||||||
limit: u64,
|
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<()> {
|
pub fn run(client: &Client, args: Args) -> Result<()> {
|
||||||
let repo = client.repo();
|
let repo = client.repo();
|
||||||
let mut path = format!(
|
let mut path = format!(
|
||||||
|
|
|
||||||
|
|
@ -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<()> {
|
pub fn run(client: &Client, args: Args) -> Result<()> {
|
||||||
let repo = client.repo();
|
let repo = client.repo();
|
||||||
match args.action.unwrap_or(Action::List) {
|
match args.action.unwrap_or(Action::List) {
|
||||||
|
|
|
||||||
|
|
@ -13,11 +13,6 @@ pub struct Args {
|
||||||
number: u64,
|
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<()> {
|
pub fn run(client: &Client, args: Args) -> Result<()> {
|
||||||
let repo = client.repo();
|
let repo = client.repo();
|
||||||
let v = client.get_json(&format!("/repos/{repo}/pulls/{}", args.number))?;
|
let v = client.get_json(&format!("/repos/{repo}/pulls/{}", args.number))?;
|
||||||
|
|
|
||||||
|
|
@ -13,11 +13,6 @@ pub struct Args {
|
||||||
number: u64,
|
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<()> {
|
pub fn run(client: &Client, args: Args) -> Result<()> {
|
||||||
let repo = client.repo();
|
let repo = client.repo();
|
||||||
let v = client.get_json(&format!("/repos/{repo}/pulls/{}/reviews", args.number))?;
|
let v = client.get_json(&format!("/repos/{repo}/pulls/{}/reviews", args.number))?;
|
||||||
|
|
|
||||||
|
|
@ -21,11 +21,6 @@ pub struct Args {
|
||||||
unwatch: bool,
|
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<()> {
|
pub fn run(client: &Client, args: Args) -> Result<()> {
|
||||||
let repo = client.repo();
|
let repo = client.repo();
|
||||||
if args.unwatch {
|
if args.unwatch {
|
||||||
|
|
|
||||||
|
|
@ -32,11 +32,6 @@ pub struct Args {
|
||||||
limit: u64,
|
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<()> {
|
pub fn run(client: &Client, args: Args) -> Result<()> {
|
||||||
let repo = client.repo();
|
let repo = client.repo();
|
||||||
let v = client.get_json(&format!(
|
let v = client.get_json(&format!(
|
||||||
|
|
|
||||||
|
|
@ -13,11 +13,6 @@ pub struct Args {
|
||||||
reference: String,
|
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<()> {
|
pub fn run(client: &Client, args: Args) -> Result<()> {
|
||||||
let repo = client.repo();
|
let repo = client.repo();
|
||||||
// Try branch first; the bash helper silently treats failure as
|
// Try branch first; the bash helper silently treats failure as
|
||||||
|
|
|
||||||
|
|
@ -13,11 +13,6 @@ pub struct Args {
|
||||||
number: u64,
|
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<()> {
|
pub fn run(client: &Client, args: Args) -> Result<()> {
|
||||||
let repo = client.repo();
|
let repo = client.repo();
|
||||||
let issue = client.get_json(&format!("/repos/{repo}/issues/{}", args.number))?;
|
let issue = client.get_json(&format!("/repos/{repo}/issues/{}", args.number))?;
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue