Skip to content

fix(cargo-gamma): include Some value mutants by default - #244

Closed
chinayangxiaowei wants to merge 1 commit into
microsoft:mainfrom
chinayangxiaowei:fix/cargo-gamma-some-default
Closed

chinayangxiaowei wants to merge 1 commit into
microsoft:mainfrom
chinayangxiaowei:fix/cargo-gamma-some-default

Conversation

@chinayangxiaowei

Copy link
Copy Markdown
Contributor

Problem

fn_value.some was excluded from @default, so a default run did not generate Some(value) whole-body mutants for functions returning Option<T>. Users had to add --mutators @default,fn_value.some explicitly.

Change

  • Include fn_value.some in the default selection.
  • Keep @pedantic as a focused alias for the same mutator, preserving scripts that select it.
  • Update the engine and CLI design and user documentation, and assert that default selection generates Some(0) and Some(1) for an Option<u8> return.

Validation

  • cargo fmt --all -- --check passed.
  • cargo test --locked -p cargo-gamma-engine --lib passed: 811 tests.

This PR contains one independent default-selection change. It does not include the macOS, workspace, regex, or reference-return patches in #240–#243.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

The sample configuration still contains obsolete guidance to add @pedantic for non-default mutations.

1 open finding
What changed in this PR

Enables fn_value.some mutants by default while retaining @pedantic as a focused alias.

Changes:

  • Adds fn_value.some to the default mutator catalog.
  • Tests default Some(0) and Some(1) generation.
  • Updates engine and CLI documentation.
File Description
crates/​cargo-gamma/​src/​main.rs Updates CLI documentation.
crates/​cargo-gamma/​README.md Updates generated user documentation.
crates/​cargo-gamma/​docs/​MUTATORS.md Documents default and preset membership.
crates/​cargo-gamma/​docs/​DESIGN.md Records CLI selection behavior.
crates/​cargo-gamma/​docs/​CONFIG.md Updates configuration guidance.
crates/​cargo-gamma-engine/​src/​ops/​registry/​selection.rs Tests default and pedantic selection.
crates/​cargo-gamma-engine/​src/​ops/​registry/​catalog.rs Enables the mutator by default.
crates/​cargo-gamma-engine/​src/​ops/​collect/​tests.rs Adds default-selection regression coverage.
crates/​cargo-gamma-engine/​docs/​DESIGN.md Records engine behavior.

🧠 Review effort: Balanced


💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread crates/cargo-gamma/docs/CONFIG.md
Copilot AI balanced review requested due to automatic review settings October 10, 2026 20:57
@chinayangxiaowei
chinayangxiaowei force-pushed the fix/cargo-gamma-some-default branch from 350d3ca to da895b9 Compare October 10, 2026 20:57

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟢 Approval recommended

The focused registry change is consistently documented and covered by tests for selection and generated candidates.

1 open finding

🧠 Review effort: Balanced

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟢 Approval recommended

The focused registry change is consistently documented and covered by selection and candidate-generation tests.

0 open findings

1 resolved since last review

🧠 Review effort: Balanced

@geeknoid

Copy link
Copy Markdown
Member

This was intentional, this mutator is too noisy to be on by default.

@chinayangxiaowei

Copy link
Copy Markdown
Contributor Author

Thanks for clarifying the intention. I approached this from the broader mutation coverage I was used to with cargo-mutants, and I understand the concern about noise in the default set.

I'm happy to keep fn_value.some opt-in upstream and enable it explicitly for my own runs with --mutators @default,fn_value.some. Thanks for explaining the tradeoff.

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.

3 participants