Skip to content

Conversation

andreimerlescu
Copy link
Owner

No description provided.

@Copilot Copilot AI review requested due to automatic review settings July 3, 2025 09:11
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

This PR refactors flag handling and error management by introducing custom error types and routing flag registrations through a figTree instance rather than the global flag package.

  • Replace fmt.Errorf calls with ErrInvalidValue, ErrConversion, and ErrInvalidType for richer error types
  • Switch all flag.Var invocations in New… and WithAlias methods to tree.flagSet.Var
  • Add Mutagenesis.Kind, consolidate and expose MutagenesisOf functions in a new mutagenesis.go

Reviewed Changes

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

Show a summary per file
File Description
parsing.go Use ErrInvalidValue instead of fmt.Errorf in error returns
mutations_new.go Update flag.Vartree.flagSet.Var in all New* definitions
mutagenesis.go New file: Mutagenesis.Kind(), global & tree MutagenesisOf
loading.go Reorder imports
errors.go Define ErrInvalidType, ErrConversion, ErrInvalidValue
conversions.go Replace default fmt.Errorf with ErrConversion
assure.go Replace fmt.Errorf in validators with ErrInvalidType
alias.go Change global flag.Vartree.flagSet.Var for aliases
Comments suppressed due to low confidence (1)

errors.go:34

  • [nitpick] Using %T prints only the Go type of e.Got, not its value. Consider using %v to include the actual value or adjust the message for clarity, e.g., fmt.Sprintf("failed to convert %v (type %T) from %s to %s", e.Got, e.Got, e.From.Kind(), e.To.Kind()).
	return fmt.Sprintf("failed to convert %T type %s into %s", e.Got, e.From.Kind(), e.To.Kind())

@andreimerlescu andreimerlescu merged commit 4063890 into main Jul 3, 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