Commit c5555c2
committed
fix(engine): tighten isEffectivelyEmptyYAML for indented separators
Previously the function ran bytes.TrimSpace on each line before
comparing against "---"/"...", which means an indented " ---"
(a YAML scalar inside a parent mapping, not a document separator)
would be treated as a separator and hide a real overlay. Compare
against the line minus only trailing whitespace instead — separators
must be at column 0 per the YAML spec.
Comments and blank lines still use the fully trimmed form: a
comment can be indented, an empty line is empty regardless of where
in the file it appears.
Add a regression case to TestNodeFileHasOverlay covering the
indented-separator edge.
Assisted-By: Claude <noreply@anthropic.com>
Signed-off-by: Aleksei Sviridkin <f@lex.la>1 parent 6403d1e commit c5555c2
2 files changed
Lines changed: 17 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
261 | 261 | | |
262 | 262 | | |
263 | 263 | | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
264 | 269 | | |
265 | 270 | | |
266 | 271 | | |
| |||
270 | 275 | | |
271 | 276 | | |
272 | 277 | | |
273 | | - | |
| 278 | + | |
| 279 | + | |
274 | 280 | | |
275 | 281 | | |
276 | 282 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1204 | 1204 | | |
1205 | 1205 | | |
1206 | 1206 | | |
| 1207 | + | |
| 1208 | + | |
| 1209 | + | |
| 1210 | + | |
| 1211 | + | |
| 1212 | + | |
| 1213 | + | |
| 1214 | + | |
| 1215 | + | |
| 1216 | + | |
1207 | 1217 | | |
1208 | 1218 | | |
1209 | 1219 | | |
| |||
0 commit comments