Skip to content

[codex] replace derived Show impls and deprecate weak Show cases#3452

Draft
peter-jerry-ye wants to merge 2 commits into
mainfrom
zihang/cleanup-derive-show
Draft

[codex] replace derived Show impls and deprecate weak Show cases#3452
peter-jerry-ye wants to merge 2 commits into
mainfrom
zihang/cleanup-derive-show

Conversation

@peter-jerry-ye

Copy link
Copy Markdown
Collaborator

Summary

This PR removes live derive(Show) usage from the affected core packages and replaces each one with an explicit standalone impl Show.

It also removes the #warnings("-deprecated_syntax") suppressions that were masking those definitions, regenerates the affected .mbti files, and deprecates the new Show impls whose output should not be treated as stable API.

What Changed

  • replaced live source derive(Show) definitions with explicit impl Show
  • removed deprecated-syntax warning suppressions from the touched source files
  • deprecated Show for RandomState, FlagAction, and OptionAction
  • kept Show non-deprecated for intentional string forms such as Failure, JsonDecodeError, Reverse, ValueRange, and ValueSource
  • updated the quickcheck/splitmix README to stop demonstrating RandomState::to_string()
  • regenerated affected pkg.generated.mbti files

Why

The repo still had a small set of derive(Show) sites that depended on deprecated syntax, and some of those sites were shielded by local warning suppressions.

Converting them to explicit impls makes the behavior visible in ordinary source, removes reliance on deprecated syntax, and exposes any remaining issues directly. The follow-up deprecations keep weak or incidental string representations from becoming encouraged public API.

Impact

  • the deprecated-syntax suppressions in the touched files are gone
  • the exported API now shows standalone impl Show entries instead of derive(Show) in generated interfaces
  • callers that stringify RandomState, FlagAction, or OptionAction will now see deprecation metadata

Validation

  • moon info
  • moon fmt
  • moon check
  • moon test argparse json builtin cmp quickcheck/splitmix
  • moon test argparse quickcheck/splitmix

@coveralls

Copy link
Copy Markdown
Collaborator

Coverage Report for CI Build 3895

Coverage decreased (-0.1%) to 94.762%

Details

  • Coverage decreased (-0.1%) from the base build.
  • Patch coverage: 19 uncovered changes across 4 files (22 of 41 lines covered, 53.66%).
  • No coverage regressions found.

Uncovered Changes

File Changed Covered %
argparse/arg_spec.mbt 9 0 0.0%
quickcheck/splitmix/random.mbt 5 0 0.0%
argparse/matches.mbt 4 0 0.0%
argparse/value_range.mbt 10 9 90.0%

Coverage Regressions

No coverage regressions found.


Coverage Stats

Coverage Status
Relevant Lines: 15560
Covered Lines: 14745
Line Coverage: 94.76%
Coverage Strength: 220517.98 hits per line

💛 - Coveralls

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