Skip to content

Conversation

premultiply
Copy link
Member

@andig
Copy link
Member

andig commented Oct 7, 2025

Kann rein?

@premultiply premultiply marked this pull request as ready for review October 12, 2025 06:26
Copy link
Contributor

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey there - I've reviewed your changes - here's some feedback:

  • Extract the repeated timeout flag addition and retrieval logic into a shared helper to reduce duplication across commands.
  • Consider handling the error returned by cmd.Flags().GetDuration instead of ignoring it to avoid masking potential flag parsing issues.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- Extract the repeated timeout flag addition and retrieval logic into a shared helper to reduce duplication across commands.
- Consider handling the error returned by cmd.Flags().GetDuration instead of ignoring it to avoid masking potential flag parsing issues.

## Individual Comments

### Comment 1
<location> `cmd/dump.go:95-96` </location>
<code_context>
 	}

-	d := dumper{len: 2}
+	timeout, _ := cmd.Flags().GetDuration(flagTimeout)
+	d := dumper{len: 2, timeout: timeout}

 	d.Header("config", "=")
</code_context>

<issue_to_address>
**issue (bug_risk):** Handle potential errors from GetDuration to avoid silent failures.

Explicitly handle errors from GetDuration to prevent unexpected behavior when the flag value is malformed. Provide user feedback if parsing fails.
</issue_to_address>

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@premultiply premultiply merged commit f8b6c36 into master Oct 12, 2025
7 checks passed
@premultiply premultiply deleted the chore/dumper-timeout branch October 12, 2025 06:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants