Skip to content

Test markdown validity after usethis badge calls#1584

Merged
nathanjmcdougall merged 2 commits into
mainfrom
copilot/test-markdown-validity
Mar 27, 2026
Merged

Test markdown validity after usethis badge calls#1584
nathanjmcdougall merged 2 commits into
mainfrom
copilot/test-markdown-validity

Conversation

Copilot AI commented Mar 27, 2026

Copy link
Copy Markdown
Contributor

Adds a regression guard against invalid badge markdown (like #923) by comparing badge output against a canonical .md file that prek validates.

  • Canonical asset: tests/usethis/_core/assets/expected_all_badges.md — the expected README after all 7 badge commands run in sequence. Validated by markdownlint-cli2 + prettier via prek hooks.
  • Test: TestAllBadgesMarkdownValid in test_core_badge.py — sets up a blank-slate project, runs all add_badge() calls in order, asserts output matches the canonical file.

If badge output changes to produce invalid markdown, either the test fails (output mismatch) or the canonical file update gets caught by prek.


⚡ Quickly spin up Copilot coding agent tasks from anywhere on your macOS or Windows machine with Raycast.

Creates a canonical expected_all_badges.md file that prek (markdownlint +
prettier) validates, and a test that runs all 7 badge commands on a blank-slate
project and compares the resulting README against this canonical file.

Agent-Logs-Url: https://github.com/usethis-python/usethis-python/sessions/d900c1cf-759f-4cd3-85a2-4ccac33d5116

Co-authored-by: nathanjmcdougall <18602289+nathanjmcdougall@users.noreply.github.com>
Copilot AI changed the title [WIP] Add test for markdown validity after usethis badge calls Test markdown validity after usethis badge calls Mar 27, 2026
Copilot AI requested a review from nathanjmcdougall March 27, 2026 05:08
@nathanjmcdougall nathanjmcdougall marked this pull request as ready for review March 27, 2026 08:56
@codecov

codecov Bot commented Mar 27, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ All tests successful. No failed tests found.

📢 Thoughts on this report? Let us know!

@codspeed-hq

codspeed-hq Bot commented Mar 27, 2026

Copy link
Copy Markdown

Merging this PR will not alter performance

✅ 2 untouched benchmarks


Comparing copilot/test-markdown-validity (438dfa2) with main (77332b1)1

Open in CodSpeed

Footnotes

  1. No successful run was found on main (5ec237a) during the generation of this report, so 77332b1 was used instead as the comparison base. There might be some changes unrelated to this pull request in this report.

@nathanjmcdougall nathanjmcdougall merged commit 5f187dd into main Mar 27, 2026
20 checks passed
@nathanjmcdougall nathanjmcdougall deleted the copilot/test-markdown-validity branch March 27, 2026 09:09
@nathanjmcdougall nathanjmcdougall linked an issue Mar 30, 2026 that may be closed by this pull request
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.

Test markdown is valid after usethis badge calls

2 participants