Skip to content

gate example ports, adapters etc behind copier question #5

Description

@mariushelf

Allow user to skip creation of example implementations.

Nice for beginners, annoying for experienced users.

Activity

  1. mariushelf commented on Aug 14, 2026

    @mariushelf
    OwnerAuthor

    Delivered by #3 ("feat: make hexagonal scaffolding optional via copier question", merged 2026-06-11), which never linked back here. Closing as completed.

    copier.yml carries an include_hexagonal bool question (default true). With it set to false the generated project is the flat main/settings/utils layout with none of the hexagonal machinery:

    • domain/, services/, adapters/ and test_example_notes.py gated via Jinja conditional path names
    • import-linter dependency and [tool.importlinter] contracts gated in pyproject.toml.jinja
    • lint-imports pre-commit hook, the Makefile import_lint target, and the README / AGENTS.md architecture sections all gated
    • tests/test_template.py parametrised over include_hexagonal=[True, False], so every check runs against both the hexagonal and the flat project

    Verified on origin/main: no example content leaks into the flat variant. The remaining ungated modules (main.py, utils.py, test_<slug>.py) are genuine scaffolding — logging setup and a semver assertion — and the "Adapter A/B" mermaid in docs/source/architecture/index.md is a generic placeholder, not hexagonal content.

    Residual, deliberately not tracked as a separate ticket for now: the question couples the architecture with the example slice, so there is no way to scaffold hexagonal layers without the Note example. In hexagonal mode AGENTS.md still instructs "Search for # --- example and delete those blocks", and six files carry that marker. An include_examples question, independent of include_hexagonal, would serve the "annoying for experienced users" motivation above. Worth reopening or filing fresh if that friction shows up in practice.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions