Repository navigation
Use hyphens, not underscores, in generated GitHub repository URLs - #17
mariushelf wants to merge 3 commits into
Conversation
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Derive the repository name from project_slug with underscores replaced by hyphens, as already done for the distribution name. Import paths and import-linter contracts keep the underscored slug. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
|
Build complete. Cost: build $0.25 (sonnet, effort high) · ticket total $0.78 · API list price ~Written by Claude, run via the agentic engineering loop |
mariushelf
left a comment
There was a problem hiding this comment.
Review round 1 — approve
Approve. The change pipes project_slug through replace('_', '-') in the GitHub URLs at template/pyproject.toml.jinja:28-29 and template/README.md.jinja:3 and :9. This matches the existing distribution-name derivation. The wheel packages entry, the import-linter contracts and the src/ paths keep the underscored project_slug.
A new parametrized test, test_github_urls_use_hyphenated_repo_name, checks the pyproject URLs and the README URLs. It also scans every rendered file for an underscored repository URL, in the hexagonal layout and in the flat layout.
The riskiest criterion is that the test fails against the old template. Decisive evidence: with the two template files restored from c4ea508, both parametrized cases failed. With the fix in place, the full suite passed, 31 tests.
The diff also adds the loop artifacts plan/issue-16.md and spec/issue-16.md. tasks/pr-comments.md contains no review flags.
Acceptance criteria
- In a project generated with
project_slug = "test_project"andgithub_username = "testuser",pyproject.tomlhasHomepageandRepositoryequal tohttps://github.com/testuser/test-project.: met - In the same project, every
github.com/testuser/...URL inREADME.mdusestest-project, and none usestest_project.: met - No other generated file contains
github.com/<github_username>/<project_slug>with an underscore (checked by grep over the rendered project).: met - A test in
tests/test_template.pyrenders the template and asserts the two criteria above, and fails against the current template.: met - Python import paths, the package directory under
src/, and import-linter contracts still useproject_slugwith underscores (existing tests stay green).: met
Cost: review $0.36 (opus, effort high) · ticket total $1.14 · API list price
~Written by Claude, run via the agentic engineering loop
|
Review verdict: approved (tier 0) ~Written by Claude, run via the agentic engineering loop |
|
Cost summary (API list price)
~Written by Claude, run via the agentic engineering loop |
Generated projects now point their GitHub URLs at the hyphenated repository name, so
project_slug = auto_shoppergivesgithub.com/<user>/auto-shopper. The full suite passes (31 tests), and the work is committed with a clean tree. I did not push.What changed
template/pyproject.toml.jinja: theHomepageandRepositoryURLs use{{ project_slug | replace('_', '-') }}.template/README.md.jinja: the CI badge image and link (line 3) and the "Original repository" link (line 9) use the same expression.tests/test_template.py: a new test,test_github_urls_use_hyphenated_repo_name, runs for both the hexagonal and flat layouts. For each it renders the template withoutuv syncand checks three things:pyproject.tomlURLs equalhttps://github.com/testuser/test-project;github.com/testuser/...URL inREADME.mdusestest-project;github.com/testuser/test_project.Test-first check: before the fix, both cases failed on the
pyproject.tomlURL assertion. After the fix, both pass.Commits
17a41a4—test: assert generated GitHub URLs use hyphenated repo name2be5cb3—fix: use hyphens in generated GitHub repository URLsRisk
src/package directory and the import-linter contracts still use the underscored slug. The existing import, lint and generated-test checks in the suite pass.copier updatepicks up the change.graphify update .was skipped because this worktree has nographify-out/.Fixes #16
~Written by Claude, run via the agentic engineering loop