aboutsummaryrefslogtreecommitdiff
path: root/.ai/scripts/lint-org.el
diff options
context:
space:
mode:
authorCraig Jennings <c@cjennings.net>2026-07-24 00:02:13 -0500
committerCraig Jennings <c@cjennings.net>2026-07-24 00:02:13 -0500
commitc38bab9f0005a7da82487674d3d8bceca36368a9 (patch)
tree89f3832e794c5c1fd7b73151c588d3281da653c0 /.ai/scripts/lint-org.el
parenta053e9d1ecbf583b4a6f054c34f64ad1f359365e (diff)
downloadrulesets-c38bab9f0005a7da82487674d3d8bceca36368a9.tar.gz
rulesets-c38bab9f0005a7da82487674d3d8bceca36368a9.zip
fix(lint-org): scope the todo-format checkers out of docs/specs/
The five todo-format-family checkers encode todo.org completion conventions, but they ran on every org file, so they misfired across docs/specs/. That was 100 findings over nine specs in this repo, and the same noise in every project carrying specs. A spec's Decisions section legitimately uses a level-2 DONE with no CLOSED cookie. Its review-history uses level-2 dated headings. Neither is a completion defect there. A path guard now skips the family on any file under a docs/specs/ segment, the canonical spec home per the docs-lifecycle rule. Link, table, and structural checks still run on specs, so a broken link in one still flags. todo.org and every non-spec org file keep the full checker set. Folds in task-missing-last-reviewed alongside the four named checkers, since it's the same family and misfires the same way on a spec's phase tasks. Correcting an earlier note in the task: these are lint-org.el's own checkers, not org-lint's, so the fix is a local guard rather than filtering upstream output.
Diffstat (limited to '.ai/scripts/lint-org.el')
-rw-r--r--.ai/scripts/lint-org.el32
1 files changed, 25 insertions, 7 deletions
diff --git a/.ai/scripts/lint-org.el b/.ai/scripts/lint-org.el
index 1bd4582..928f83b 100644
--- a/.ai/scripts/lint-org.el
+++ b/.ai/scripts/lint-org.el
@@ -76,6 +76,18 @@ The CLI defaults this to t (a linter reports, it doesn't write);
`--fix' is what enables writes on a command-line run.")
(defvar lo-current-file nil
"Path of the file currently being processed.")
+
+(defun lo--spec-file-p ()
+ "Non-nil when the current file lives under a docs/specs/ directory.
+The four todo-format-family checkers encode todo.org completion conventions
+and misfire on a spec: a spec's Decisions section legitimately carries a
+level-2 DONE with no CLOSED cookie, and its review-history section carries
+level-2 dated headings. docs/specs/ is the canonical spec home per the
+docs-lifecycle rule, so a path segment match is the scope test. Link,
+table, and structural checks still run on specs — only the todo-format
+family is scoped out."
+ (and lo-current-file
+ (string-match-p "/docs/specs/" (expand-file-name lo-current-file))))
(defvar lo-followups-file nil
"When non-nil, after a non-check run any judgment items are appended to this
path as an org section dated today. The file is created if missing.")
@@ -657,16 +669,22 @@ left unmodified and mechanical entries are recorded with :preview t."
;; After org-lint items: the custom table-standard scan. Runs on the
;; post-fix buffer; judgment-only, so order doesn't perturb fixes.
(lo--check-tables)
- ;; Same shape: flag level-2 dated headers (completion defects).
- (lo--check-level2-dated-headers)
- ;; Structural heading defects org-lint doesn't cover.
+ ;; Structural heading defects org-lint doesn't cover. These run on
+ ;; every org file, specs included.
(lo--check-indented-headings)
(lo--check-empty-headings)
(lo--check-malformed-priority-cookies)
- (lo--check-level2-done-without-closed)
- (lo--check-task-missing-last-reviewed)
- (lo--check-subtask-done-not-dated)
- (lo--check-dated-log-active-timestamp)
+ ;; The todo-format family encodes todo.org completion conventions and
+ ;; misfires on a spec (a Decisions section's undated DONE, a
+ ;; review-history dated heading, a phases task with no LAST_REVIEWED).
+ ;; Scope them out of docs/specs/; link, table, and structural checks
+ ;; above still run there.
+ (unless (lo--spec-file-p)
+ (lo--check-level2-dated-headers)
+ (lo--check-level2-done-without-closed)
+ (lo--check-task-missing-last-reviewed)
+ (lo--check-subtask-done-not-dated)
+ (lo--check-dated-log-active-timestamp))
(when (and (not lo-check-only) (buffer-modified-p))
(save-buffer)))
(with-current-buffer buf (set-buffer-modified-p nil))