Commit 5dc1ee6
fix(validator): detect name= in single-line pedigree assignment (#20)
Why: developer-ecosystem@baab1534 revealed that `pedigree = component_pedigree
& { name = "..." }` written on a single line was not detected by the validator.
The `name =` check used `^[[:space:]]+name[[:space:]]*=` which requires name to
start a line with leading whitespace. On a single-line pedigree the opening and
closing braces appear on the same line as `pedigree =`, so pedigree_depth
returns to 0 immediately and subsequent line-iteration never has a chance to see
`name =` on a freshly-indented line.
Change (option b — parse the whole logical unit): the `name =` and
`version|schema_version =` checks now carry a second condition using the
unanchored pattern `[[:space:]]name[[:space:]]*=` which matches the inline
form. The existing anchored check is kept for the normal multi-line case.
Both checks are guarded by `in_pedigree == true` so they only fire within
the recognised pedigree block.
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>1 parent 9b0068f commit 5dc1ee6
1 file changed
Lines changed: 15 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
197 | 197 | | |
198 | 198 | | |
199 | 199 | | |
200 | | - | |
201 | | - | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
202 | 213 | | |
203 | 214 | | |
204 | 215 | | |
205 | 216 | | |
206 | | - | |
| 217 | + | |
| 218 | + | |
207 | 219 | | |
208 | 220 | | |
209 | 221 | | |
| |||
0 commit comments