]> gitweb.factorcode.org Git - factor.git/commitdiff
help.lint.checks: add a help-lint check for bad $slot tables.
authorJohn Benediktsson <mrjbq7@gmail.com>
Mon, 9 Nov 2020 16:40:51 +0000 (08:40 -0800)
committerJohn Benediktsson <mrjbq7@gmail.com>
Mon, 9 Nov 2020 16:40:51 +0000 (08:40 -0800)
basis/help/lint/checks/checks.factor

index af7880d9b3bfdd2722462d9f3e46178cbe3610af..e530e1306c4eecca67556e3bf490767f18479aba 100644 (file)
@@ -144,6 +144,10 @@ SYMBOL: vocab-articles
         ] unless
     ] each ;
 
+: check-slots-tables ( element -- )
+    \ $slots swap elements [ rest [ length 2 = ] all?  ] all?
+    [ "$slots have too many values in at least one row" simple-lint-error ] unless ;
+
 : check-rendering ( element -- )
     [ print-content ] with-string-writer drop ;
 
@@ -219,6 +223,7 @@ SYMBOL: vocab-articles
         [ check-examples ]
         [ check-modules ]
         [ check-descriptions ]
+        [ check-slots-tables ]
     } cleave ;
 
 : files>vocabs ( -- assoc )