Commit f1e2cca
Pin the four hand-copied patterns the sync roster never listed
The M11 orphan sweep turned up not dead code but an unenforced promise.
_render's _SPACES, _SPACE_BEFORE_COMMA, _MAC and _WORD are hand-copies
of nameparser.config.regexes keys, and test_regex_sync.py -- whose
docstring says "nothing previously enforced that promise" -- covered
eleven such copies and not these four. They had not diverged; nothing
would have reported it if they had.
They went unnoticed because the config keys lost their only other
reader when M11 deleted v1's parser.py (space_before_comma was
parser.py:305), so the config side looks unused and the render side
looks self-contained. Same shape as regexes.no_vowels (#268) and
util.py's orphans, except here the pattern is still needed -- it just
has two definitions and no link between them.
Declared as a roster with a completeness check rather than one test per
copy: the roster grew one test at a time, which is exactly how four
copies were left out. A compiled pattern in those modules that is not
declared -- with its config key, or None for the ones pinned by
relationship (the _INITIAL pair) or sourced elsewhere (_COMMA_CHAR
mirrors _state.COMMA_CHARS) -- now fails. Verified both directions:
an undeclared new pattern fails the completeness check, and editing
_SPACE_BEFORE_COMMA fails its sync assertion.
Also pins _COMMA_CHAR against COMMA_CHARS, which had no test at all.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>1 parent f65ed13 commit f1e2cca
1 file changed
Lines changed: 78 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
12 | 16 | | |
13 | 17 | | |
14 | 18 | | |
| |||
71 | 75 | | |
72 | 76 | | |
73 | 77 | | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
0 commit comments