diff options
| author | Craig Jennings <c@cjennings.net> | 2026-05-15 23:03:10 -0500 |
|---|---|---|
| committer | Craig Jennings <c@cjennings.net> | 2026-05-15 23:03:10 -0500 |
| commit | dc1661c222304dddd797bece882bb2501d2b6e76 (patch) | |
| tree | 58ebf60dc43980fef72ed3730941f68674cf1db9 /scripts/readability | |
| parent | 8577a880bbb84879a9297ebd28d6370c5e62727d (diff) | |
| download | rulesets-dc1661c222304dddd797bece882bb2501d2b6e76.tar.gz rulesets-dc1661c222304dddd797bece882bb2501d2b6e76.zip | |
fix(cj-scan): suppress detection inside nested non-cj begin_* blocks
cj-scan.py matched =#+begin_src cj:= / =#+end_src= line-by-line without awareness of enclosing block scopes. A cj fence embedded inside =#+begin_example= (typical when documenting what the <cj yasnippet emits) or =#+begin_src snippet= (the yasnippet definition itself) was misclassified as a live cj annotation. Two false positives surfaced from a /respond-to-cj-comments run against an org file with yasnippet docs.
Track an active wrapper_type. When the scanner sees =#+begin_<type>= for any type other than cj: (the cj-open regex is checked first), enter a wrapper state where every line is content until the matching =#+end_<type>= closer fires. Inside a wrapper, both fence patterns and legacy inline cj: lines stay suppressed. Added the TestCjScanNestedFencesIgnored class with 6 tests: nesting inside example, src <other-lang>, and quote; regression guards for clean wrapper close and unclosed-wrapper non-swallow. Canonical pytest: 302 passed, 1 skipped.
Diffstat (limited to 'scripts/readability')
0 files changed, 0 insertions, 0 deletions
