Skip to content

Preserve metadata before the first usage header - #145

Open
vinsymoyya wants to merge 1 commit into
google:mainfrom
vinsymoyya:fix/usage-metadata-defaults
Open

vinsymoyya wants to merge 1 commit into
google:mainfrom
vinsymoyya:fix/usage-metadata-defaults

Conversation

@vinsymoyya

Copy link
Copy Markdown

Metadata before the first @usage currently disappears from later usage variants: @dict SomeDict produces SomeDict.Foo for the first variant and x#Foo for subsequent variants. A preceding @public also applies only to the first variant.

Snapshot the local metadata when a block receives its first header and use that snapshot as the defaults for subsequent headers. Metadata introduced after a header remains local to that usage. Regression tests cover dictionary naming across three usages, public visibility, and isolation of per-usage directives.

Fixes #74.

Validation: the two metadata regressions fail against upstream b2b9273; all 12 tests/doctest modules pass after the fix using python -m pytest -q --doctest-modules. git diff --check passes. The source checkout emits the existing missing setuptools-scm version warning. No dependencies or CI configuration changed.

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.

Directives above @usage header only apply to first @usage

1 participant