diff --git a/eng/design_graph.py b/eng/design_graph.py index 045074f..024b704 100644 --- a/eng/design_graph.py +++ b/eng/design_graph.py @@ -38,7 +38,7 @@ def graph(root, docs=None): if not m:continue if m[1] in INACTIVE: for line in text.splitlines(): - if re.match(r'^(?:> Upstream:|\*\*(?:Upstream|Downstream):\*\*)',line) and ids(line): + if re.match(r'^(?:> (?:Upstream|Downstream):|\*\*(?:Upstream|Downstream):\*\*)',line) and ids(line): errors.append([p,'inactive package edges']) continue key=m[1] diff --git a/eng/design_policy.py b/eng/design_policy.py index 2042ad1..a23185c 100644 --- a/eng/design_policy.py +++ b/eng/design_policy.py @@ -135,7 +135,7 @@ def glossary(docs, commit): require(retired or term_spaces, f'missing term spaces at {number}') namespaces = {name.rsplit('.', 1)[0] if '.' in name else 'shared' for name in names} require(len(namespaces) == 1, f'mixed term namespaces at {number}') - if section.startswith('5.'): + if section.split('.', 1)[0] == '5': require(all('.' in name for name in names), f'unqualified product term at {number}') terms.append({'section': section, 'line': number, 'term': cs[0], 'names': names, 'namespace': next(iter(namespaces)), 'spaces': term_spaces, diff --git a/eng/test_design_policy.py b/eng/test_design_policy.py index 985b768..fda391d 100644 --- a/eng/test_design_policy.py +++ b/eng/test_design_policy.py @@ -266,6 +266,7 @@ def test_glossary_rejects_duplicate_names_missing_spaces_and_unqualified_product for old, new, diagnostic in [ ('**ArcNotes.Document** / **ArcNotes.Note**', '**Workspace**', 'duplicate canonical term'), ('**ArcNotes.Document** / **ArcNotes.Note**', '**Document**', 'unqualified product'), + ('### 5.1 Notes\n| **ArcNotes.Document** / **ArcNotes.Note**', '| **Document**', 'unqualified product'), ('| domain, wire |', '| mystery |', 'invalid term spaces'), ('| domain, wire |', '| |', 'invalid term spaces'), ]: @@ -365,6 +366,7 @@ def test_independent_graph_and_every_drift_representation(self): (INDEX, '| 20 | Future | — |', '| 20 | Future | `01` |', 'inactive phase edges'), (SEQUENCE, '| 02 | `01` |', '| 02 | `20` |', 'inactive producer'), ('docs/planning/work-packages/20-future.md', 'No active edges.', '> Upstream: `01`', 'inactive package edges'), + ('docs/planning/work-packages/20-future.md', 'No active edges.', '> Downstream: `01`', 'inactive package edges'), ] for path, old, new, diagnostic in cases: with self.subTest(diagnostic=diagnostic):