Skip to content

test(rename): cover no-arg module-path derivation from the git remote#132

Merged
devantler merged 1 commit into
mainfrom
claude/test-rename-derive-from-remote
Jun 27, 2026
Merged

test(rename): cover no-arg module-path derivation from the git remote#132
devantler merged 1 commit into
mainfrom
claude/test-rename-derive-from-remote

Conversation

@devantler

Copy link
Copy Markdown
Contributor

🤖 Generated by the Daily AI Assistant

What

Extends scripts/rename-placeholders.test.sh to exercise the script's no-argument path — deriving the Go module path from origin's GitHub remote.

Why

rename-placeholders.sh is the first thing a newcomer runs after Use this template, and running it with no argument is its documented default:

With no argument it derives the path from origin's GitHub remote.

That branch parses the remote URL — strip everything up to github.com, handle the scp : vs https / separator, drop the .git suffix — but every existing test case passes an explicit module path, so the derivation was unexercised. A regression there ships a wrongly-pathed scaffold to anyone who runs the default.

What the new cases pin

  • https remote: https://github.com/example-owner/renamed-project.gitmodule github.com/example-owner/renamed-project (asserts the go.mod repoint and no lingering template path).
  • scp-style remote: git@github.com:example-owner/renamed-project.git → the same derived path (proves the git@host:owner/repo.git form parses identically).

A small make_copy() helper builds each fresh throwaway repo (the existing copy is already renamed); the cleanup trap is extended to the two new copies.

Validation

  • sh scripts/rename-placeholders.test.shPASS (all cases; go build/go test still green).
  • Mutation-checked (non-vacuous): dropping the .git-suffix strip from the derivation makes go.mod carry …renamed-project.git and the https case fails as expected; restored.
  • shellcheck -s sh clean. Test-only change — rename-placeholders.sh is untouched.

Sibling to devantler-tech/dotnet-template#248, which covers the same untested derive-from-remote branch (awk PascalCase) in the .NET template.

@devantler devantler marked this pull request as ready for review June 27, 2026 08:10
@devantler devantler requested a review from a team as a code owner June 27, 2026 08:10
@devantler devantler merged commit bc2ae22 into main Jun 27, 2026
9 checks passed
@devantler devantler deleted the claude/test-rename-derive-from-remote branch June 27, 2026 08:15
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.

1 participant