Skip to content

Conversation

andreimerlescu
Copy link
Owner

No description provided.

@Copilot Copilot AI review requested due to automatic review settings July 7, 2025 13:35
@andreimerlescu andreimerlescu self-assigned this Jul 7, 2025
Copilot

This comment was marked as outdated.

andreimerlescu and others added 3 commits July 7, 2025 09:38
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@andreimerlescu andreimerlescu requested a review from Copilot July 7, 2025 13:39
Copilot

This comment was marked as outdated.

andreimerlescu and others added 2 commits July 7, 2025 10:09
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@andreimerlescu andreimerlescu requested a review from Copilot July 7, 2025 14:10
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

Updates error handling with typed error structs, enhances flag value assignment, and expands tests for value parsing and assignment.

  • Store persistent pointers for boolean flags and update flag registration
  • Replace generic fmt.Errorf errors with ErrLoadFailure/ErrValidationFailure
  • Add deep-copy logic in Value.Assign and comprehensive tests for Value.Set

Reviewed Changes

Copilot reviewed 10 out of 10 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
mutations_new.go Use a persistent pointer for bool flags and update BoolVar call
loading.go Swap fmt.Errorf for structured load/validation error types
fruit.go Introduce IsBoolFlag, use ErrInvalidValue, add deep-copy in Assign
errors.go Define ErrLoadFailure, ErrValidationFailure, ErrValue, and Unwrap methods
conversions.go Change toInt to reject float strings and check int32 overflow
conversions_test.go Adjust tests to expect errors on float-to-int parsing
assure.go Migrate validation errors to use ErrValue with standardized messages
fruit_test.go New tests covering all Value.Set mutagenesis cases
figtree_test.go Remove obsolete invalid-bool test cases
VERSION Bump version from v2.0.13 to v2.0.14
Comments suppressed due to low confidence (1)

fruit.go:182

  • [nitpick] You’ve added deep-copy logic for ListFlag and MapFlag in Assign, but there are no tests verifying that mutations of the original flag do not affect the stored Value. Consider adding tests to cover these deep-copy paths.
	case *MapFlag:

@andreimerlescu andreimerlescu merged commit 8f7aba2 into main Jul 7, 2025
6 checks passed
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.

1 participant