Ids ``scope`` (section|block) can read from the schema of ``f``: a section's ``settings`` are ``section.settings``, its ``blocks[].settings`` are ``block.settings``; a block file's own ``settings`` are ``block.settings``.
(f: str, scope: str)
| 539 | schema_cache: dict[str, set[str]] = {} |
| 540 | |
| 541 | def schema_of(f: str, scope: str) -> set[str]: |
| 542 | """Ids ``scope`` (section|block) can read from the schema of ``f``: a section's ``settings`` are |
| 543 | ``section.settings``, its ``blocks[].settings`` are ``block.settings``; a block file's own |
| 544 | ``settings`` are ``block.settings``.""" |
| 545 | if f not in schema_cache: |
| 546 | p = root / f |
| 547 | schema_cache[f] = _schema_scoped(_read(p)) if p.is_file() else (set(), set()) |
| 548 | own, blocks = schema_cache[f] |
| 549 | if f.startswith("sections/"): |
| 550 | return own if scope == "section.settings" else blocks |
| 551 | if f.startswith("blocks/"): |
| 552 | return own if scope == "block.settings" else set() |
| 553 | return set() |
| 554 | |
| 555 | for file, line, key in cases_d(root): |
| 556 | cases.append(1) |
no test coverage detected