Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion lib/src/docs/markdown/arg.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ mod tests {
fn test_render_markdown_arg() {
let spec = spec! { r#"arg "arg1" help="arg1 description""# }.unwrap();
let ctx = MarkdownRenderer::new(spec.clone());
assert_snapshot!(ctx.render_arg(&spec.cmd.args[0]).unwrap(), @"arg1 description");
assert_snapshot!(ctx.render_arg(&spec.cmd.args[0]).unwrap(), @r"


arg1 description");
Comment on lines +25 to +28
Copy link

Copilot AI Jan 19, 2026

Choose a reason for hiding this comment

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

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.

Copilot uses AI. Check for mistakes.
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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)

Fix in Cursor Fix in Web

}
}
5 changes: 4 additions & 1 deletion lib/src/docs/markdown/flag.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ mod tests {
fn test_render_markdown_flag() {
let spec = spec! { r#"flag "--flag1" help="flag1 description""# }.unwrap();
let ctx = MarkdownRenderer::new(spec.clone()).with_replace_pre_with_code_fences(true);
assert_snapshot!(ctx.render_flag(&spec.cmd.flags[0]).unwrap(), @"flag1 description");
assert_snapshot!(ctx.render_flag(&spec.cmd.flags[0]).unwrap(), @r"


flag1 description");
Comment on lines +25 to +28
Copy link

Copilot AI Jan 19, 2026

Choose a reason for hiding this comment

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

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.

Copilot uses AI. Check for mistakes.
}
}