Green, i18n-ready scaffolding and a language subtemplate#8
Merged
Conversation
- generated tree is ruff-clean out of the box (isort config + import fixes, drop unused imports, no shell=True in locales/update.py) - ct tests honour global_allow=false (create a parent container that allows the type), and drop the unused factory/fti lookup - i18n: MessageFactory in i18n.py (not __init__), zope_i18n_compile_mo_files in dev zope.conf + test layer, new language subtemplate for locale .po catalogs - fix behavior test to look up the real registered IBehavior name - github_organization option drives the generated project URLs - track .pot, ignore only .mo - tests: e2e ruff-clean generation, subtemplate idempotency, global_allow
Register the <plone:behavior> with an explicit name="<package>.<module>" instead of relying on the full interface dotted path. The short name is a stable identifier that survives moving or renaming the behavior module, and the generated test looks the behavior up by that name.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The largest slice of the original combined commit, focused on making the generated tree green and i18n-ready out of the box.
lines-after-imports), import reorders across templates, drop unused imports, and a per-file-ignore forlocales/update.py.locales/update.py: dropshell=Truein favour of list-argsubprocess.call+glob.global_allow=false: not-globally-addable types create a parent container that allows the type and add inside it; drop the unusedfactory/ftilookup.MessageFactorylives ini18n.py(not__init__),zope_i18n_compile_mo_filesset in the devzope.confand the test layer, vocab template uses_(), and a newlanguagesubtemplate scaffoldslocales/<code>/LC_MESSAGES/<domain>.po.<plone:behavior>registration now pins an explicitname="<package>.<module>"instead of relying on the full interface dotted path, and the generated test looks the behavior up by that short name. The short name survives moving/renaming the behavior module.github_organizationoption drives the generated[project.urls]..gitignore: track.pot, ignore only.mo.Test plan
tests/test_language.pytests/test_generated_ruff_clean.py(e2e: scaffolded addon is ruff-clean)tests/test_combinations.py::TestSubtemplateIdempotencytests/test_content_type.py(global_allow paths)tests/test_behavior.py(short-name registration + lookup)