chore: fix legacy inline snapshot format warnings#433
Conversation
Update inline snapshots in markdown arg/flag tests to include the actual output (with leading newlines) using raw string literals. This resolves the "existing value is in a legacy format" warnings that appeared during test runs. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
This PR resolves legacy inline snapshot format warnings in the markdown rendering tests by updating the snapshot assertions to use raw string literals that include the actual output format with leading newlines.
Changes:
- Updated inline snapshot assertions in markdown arg/flag tests to use raw string literal format (
@r"...") - Included leading newlines in snapshot values to match actual function output
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| lib/src/docs/markdown/flag.rs | Updated render_markdown_flag test snapshot to use raw string format with leading newlines |
| lib/src/docs/markdown/arg.rs | Updated render_markdown_arg test snapshot to use raw string format with leading newlines |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| assert_snapshot!(ctx.render_flag(&spec.cmd.flags[0]).unwrap(), @r" | ||
|
|
||
|
|
||
| flag1 description"); |
There was a problem hiding this comment.
The snapshot contains two leading blank lines before 'flag1 description'. If these newlines are intentional output from render_flag(), consider adding a comment explaining why the function produces this formatting, as it's not immediately clear from the test context.
| assert_snapshot!(ctx.render_arg(&spec.cmd.args[0]).unwrap(), @r" | ||
|
|
||
|
|
||
| arg1 description"); |
There was a problem hiding this comment.
The snapshot contains two leading blank lines before 'arg1 description'. If these newlines are intentional output from render_arg(), consider adding a comment explaining why the function produces this formatting, as it's not immediately clear from the test context.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #433 +/- ##
==========================================
+ Coverage 46.66% 46.71% +0.04%
==========================================
Files 46 46
Lines 6538 6544 +6
Branches 6538 6544 +6
==========================================
+ Hits 3051 3057 +6
Misses 1730 1730
Partials 1757 1757 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.
| assert_snapshot!(ctx.render_arg(&spec.cmd.args[0]).unwrap(), @r" | ||
|
|
||
|
|
||
| arg1 description"); |
There was a problem hiding this comment.
Snapshot has extra leading newline compared to template output
Medium Severity
The inline snapshot appears to contain three leading newlines, but the Tera template (arg_template.md.tera) produces only two leading newlines before the content. The template structure has {%- if arg.help_md %} followed by one blank line before the content output, which generates \n\n prefix. The snapshot shows two visually blank lines (three \n characters), creating a mismatch that would cause test failures.
Additional Locations (1)
### 🚀 Features - **(release)** add LLM-generated prose summary to release notes by [@jdx](https://github.com/jdx) in [#421](#421) - add LLM-generated release notes for GitHub releases by [@jdx](https://github.com/jdx) in [#423](#423) - add spec lint command by [@jdx](https://github.com/jdx) in [#430](#430) ### 🐛 Bug Fixes - replace unsafe path unwrap chains with proper error handling by [@jdx](https://github.com/jdx) in [#424](#424) - pass positional args through to executed scripts by [@jdx](https://github.com/jdx) in [#425](#425) - replace unimplemented!() with proper errors for unsupported shells by [@jdx](https://github.com/jdx) in [#432](#432) - update claude CLI model and add bypassPermissions by [@jdx](https://github.com/jdx) in [#435](#435) ### 🚜 Refactor - remove unused double-shebang support by [@jdx](https://github.com/jdx) in [#426](#426) - replace once_cell with std::sync::LazyLock by [@jdx](https://github.com/jdx) in [#428](#428) - improve code quality with safety and lint fixes by [@jdx](https://github.com/jdx) in [#427](#427) ### ⚡ Performance - use Arc for flag/arg keys in ParseOutput to reduce cloning by [@jdx](https://github.com/jdx) in [#422](#422) ### 🔍 Other Changes - update insta snapshots to newer format by [@jdx](https://github.com/jdx) in [#429](#429) - fix legacy inline snapshot format warnings by [@jdx](https://github.com/jdx) in [#433](#433) - replace TODO with doc comment for subcommand_lookup by [@jdx](https://github.com/jdx) in [#434](#434) ### 📦️ Dependency Updates - update actions/setup-node digest to 6044e13 by [@renovate[bot]](https://github.com/renovate[bot]) in [#419](#419) - replace dependency @tsconfig/node22 with @tsconfig/node24 by [@renovate[bot]](https://github.com/renovate[bot]) in [#418](#418)
This MR contains the following updates: | Package | Update | Change | |---|---|---| | [usage](https://github.com/jdx/usage) | minor | `2.12.0` → `2.13.1` | MR created with the help of [el-capitano/tools/renovate-bot](https://gitlab.com/el-capitano/tools/renovate-bot). **Proposed changes to behavior should be submitted there as MRs.** --- ### Release Notes <details> <summary>jdx/usage (usage)</summary> ### [`v2.13.1`](https://github.com/jdx/usage/blob/HEAD/CHANGELOG.md#2131---2026-01-19) [Compare Source](jdx/usage@v2.13.0...v2.13.1) ##### 🐛 Bug Fixes - use correct PowerShell casing in enum variant by [@​jdx](https://github.com/jdx) in [#​438](jdx/usage#438) ### [`v2.13.0`](https://github.com/jdx/usage/blob/HEAD/CHANGELOG.md#2130---2026-01-19) [Compare Source](jdx/usage@v2.12.0...v2.13.0) ##### 🚀 Features - **(release)** add LLM-generated prose summary to release notes by [@​jdx](https://github.com/jdx) in [#​421](jdx/usage#421) - add LLM-generated release notes for GitHub releases by [@​jdx](https://github.com/jdx) in [#​423](jdx/usage#423) - add spec lint command by [@​jdx](https://github.com/jdx) in [#​430](jdx/usage#430) - add PowerShell completion support by [@​jdx](https://github.com/jdx) in [#​431](jdx/usage#431) ##### 🐛 Bug Fixes - replace unsafe path unwrap chains with proper error handling by [@​jdx](https://github.com/jdx) in [#​424](jdx/usage#424) - pass positional args through to executed scripts by [@​jdx](https://github.com/jdx) in [#​425](jdx/usage#425) - replace unimplemented!() with proper errors for unsupported shells by [@​jdx](https://github.com/jdx) in [#​432](jdx/usage#432) - update claude CLI model and add bypassPermissions by [@​jdx](https://github.com/jdx) in [#​435](jdx/usage#435) ##### 🚜 Refactor - remove unused double-shebang support by [@​jdx](https://github.com/jdx) in [#​426](jdx/usage#426) - replace once\_cell with std::sync::LazyLock by [@​jdx](https://github.com/jdx) in [#​428](jdx/usage#428) - improve code quality with safety and lint fixes by [@​jdx](https://github.com/jdx) in [#​427](jdx/usage#427) ##### ⚡ Performance - use Arc for flag/arg keys in ParseOutput to reduce cloning by [@​jdx](https://github.com/jdx) in [#​422](jdx/usage#422) ##### 🔍 Other Changes - update insta snapshots to newer format by [@​jdx](https://github.com/jdx) in [#​429](jdx/usage#429) - fix legacy inline snapshot format warnings by [@​jdx](https://github.com/jdx) in [#​433](jdx/usage#433) - replace TODO with doc comment for subcommand\_lookup by [@​jdx](https://github.com/jdx) in [#​434](jdx/usage#434) ##### 📦️ Dependency Updates - update actions/setup-node digest to [`6044e13`](jdx/usage@6044e13) by [@​renovate\[bot\]](https://github.com/renovate\[bot]) in [#​419](jdx/usage#419) - replace dependency [@​tsconfig/node22](https://github.com/tsconfig/node22) with [@​tsconfig/node24](https://github.com/tsconfig/node24) by [@​renovate\[bot\]](https://github.com/renovate\[bot]) in [#​418](jdx/usage#418) </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever MR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this MR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this MR, check this box --- This MR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0Mi44NC4yIiwidXBkYXRlZEluVmVyIjoiNDIuODQuMiIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOlsiUmVub3ZhdGUgQm90IiwiYXV0b21hdGlvbjpib3QtYXV0aG9yZWQiLCJkZXBlbmRlbmN5LXR5cGU6Om1pbm9yIl19-->
Summary
This resolves the "existing value is in a legacy format" warnings that appeared during test runs for the
render_markdown_argandrender_markdown_flagtests.🤖 Generated with Claude Code
Note
Updates inline snapshots in tests to the new format.
arg.rsandflag.rstests now use@rraw string snapshots and include leading newlines to match actual outputWritten by Cursor Bugbot for commit 05cc885. This will update automatically on new commits. Configure here.