Skip to content

Commit fc4f627

Browse files
authored
chore: sync planning/index.py to canonical (fresh-adopt guard) (#116)
Pick up the canonical index.py change that tolerates a missing changes/ dir, so the vendored file is byte-identical to lesnik512/planning-convention again. No behavior change (this repo has changes/ content).
1 parent e2a17f2 commit fc4f627

1 file changed

Lines changed: 6 additions & 3 deletions

File tree

planning/index.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,8 @@ def _named(fields: dict[str, str], name: str, pattern: re.Pattern[str]) -> dict[
5858
def load_bundles() -> list[dict[str, str]]:
5959
"""Read each bundle's summary; derive date/slug from the directory name."""
6060
bundles: list[dict[str, str]] = []
61+
if not CHANGES_DIR.is_dir():
62+
return bundles
6163
for bundle in sorted(CHANGES_DIR.iterdir()):
6264
if not bundle.is_dir():
6365
continue
@@ -160,9 +162,10 @@ def _check_decision(path: pathlib.Path, violations: list[str]) -> None:
160162
def check() -> list[str]:
161163
"""Validate every bundle and decision; return the list of violation strings."""
162164
violations: list[str] = []
163-
for bundle in sorted(CHANGES_DIR.iterdir()):
164-
if bundle.is_dir():
165-
_check_bundle(bundle, violations)
165+
if CHANGES_DIR.is_dir():
166+
for bundle in sorted(CHANGES_DIR.iterdir()):
167+
if bundle.is_dir():
168+
_check_bundle(bundle, violations)
166169
if DECISIONS_DIR.is_dir():
167170
for path in sorted(DECISIONS_DIR.glob("*.md")):
168171
if path.name == "README.md" or path.name.startswith("_"):

0 commit comments

Comments
 (0)