aboutsummaryrefslogtreecommitdiff
path: root/.ai/scripts/tests
diff options
context:
space:
mode:
authorCraig Jennings <c@cjennings.net>2026-05-16 11:59:40 -0500
committerCraig Jennings <c@cjennings.net>2026-05-16 11:59:40 -0500
commit70af2a019e7592089d33a0dde4a1af699175f7ef (patch)
treeccaae88fa1bc222192c92e50cd86181df08b6240 /.ai/scripts/tests
parentc5846df088a47a6f77a298bc0431dcff66e672d2 (diff)
downloadrulesets-70af2a019e7592089d33a0dde4a1af699175f7ef.tar.gz
rulesets-70af2a019e7592089d33a0dde4a1af699175f7ef.zip
chore(ai): sync lint-org and wrap-it-up from claude-templates
Project .ai/ mirror catches up to two canonical updates already in claude-templates/: - lint-org cj-comment block suppression (3fb4c80). The =#+begin_src cj: ...= annotation pattern triggered three lint categories (suspicious-language, empty-header-argument, wrong-header-argument) as false positives at todo.org:16 and todo.org:1291. lint-org.el now recognizes the opener and skips all three on those lines. - LINT_ORG_FOLLOWUPS default flipped to =./inbox/lint-followups.org= (684891d). The previous hardcoded default routed every project's wrap-up findings into the work project's inbox. Phase A startup rsync brought both into the project mirror this morning; bundled into one chore commit since neither delta is project-specific work.
Diffstat (limited to '.ai/scripts/tests')
-rw-r--r--.ai/scripts/tests/test-lint-org.el56
1 files changed, 56 insertions, 0 deletions
diff --git a/.ai/scripts/tests/test-lint-org.el b/.ai/scripts/tests/test-lint-org.el
index 8e1ebc4..9328064 100644
--- a/.ai/scripts/tests/test-lint-org.el
+++ b/.ai/scripts/tests/test-lint-org.el
@@ -168,6 +168,31 @@ content
#+end_src
")
+;; cj-comment annotation block — Craig's convention #+begin_src cj: comment.
+;; org-lint flags the language (cj:) as unknown and the comment header arg as
+;; both missing-colon and empty-value. All three are false positives.
+(defconst lo-test--cj-comment-block "\
+* Heading
+
+#+begin_src cj: comment
+my annotation text
+#+end_src
+")
+
+;; cj-comment block alongside a real suspicious-language warning — verifies
+;; the cj suppression doesn't leak into other src blocks in the same file.
+(defconst lo-test--cj-comment-with-real-warning "\
+* Heading
+
+#+begin_src cj: comment
+my annotation
+#+end_src
+
+#+begin_src markdown
+real suspicious-language warning here
+#+end_src
+")
+
;; Mixed fixture — each category once.
(defconst lo-test--mixed "\
* Mixed
@@ -317,6 +342,37 @@ content
(lo-test--checkers judgments)))))
;;; ---------------------------------------------------------------------------
+;;; cj-comment block — Craig's annotation convention is silently suppressed
+
+(ert-deftest lo-cj-comment-block-emits-no-judgments ()
+ "Normal: a `#+begin_src cj: comment ...' block must not trigger the three
+false-positive warnings org-lint emits for it (unknown language, empty
+header-arg value, missing colon in header arg)."
+ (let* ((out (lo-test--run lo-test--cj-comment-block))
+ (res (plist-get out :result))
+ (judgments (lo-test--judgments (plist-get out :issues)))
+ (checkers (lo-test--checkers judgments)))
+ ;; File untouched, no fixes applied.
+ (should (equal lo-test--cj-comment-block res))
+ (should (= 0 (plist-get out :fixes)))
+ ;; None of the three false-positive checkers fired.
+ (should-not (member 'suspicious-language-in-src-block checkers))
+ (should-not (member 'empty-header-argument checkers))
+ (should-not (member 'wrong-header-argument checkers))))
+
+(ert-deftest lo-cj-comment-suppression-does-not-mask-real-warnings ()
+ "Boundary: the cj-comment suppression is scoped to cj-comment block openers
+only — a regular `#+begin_src markdown' in the same file still emits its
+suspicious-language judgment."
+ (let* ((out (lo-test--run lo-test--cj-comment-with-real-warning))
+ (judgments (lo-test--judgments (plist-get out :issues)))
+ (suspicious (cl-count 'suspicious-language-in-src-block
+ (lo-test--checkers judgments))))
+ ;; Exactly one suspicious-language judgment — from the markdown block,
+ ;; not the cj-comment block.
+ (should (= 1 suspicious))))
+
+;;; ---------------------------------------------------------------------------
;;; --check mode
(ert-deftest lo-check-mode-does-not-modify-file ()