]> gitweb.factorcode.org Git - factor.git/commitdiff
final fixups
authorCat Stevens <catb0t@protonmail.ch>
Mon, 12 Feb 2018 03:48:24 +0000 (22:48 -0500)
committerJohn Benediktsson <mrjbq7@gmail.com>
Mon, 12 Feb 2018 04:24:40 +0000 (20:24 -0800)
extra/help/lint/coverage/coverage-tests.factor
extra/help/lint/coverage/coverage.factor

index 1839d6051e6ad55301a81412eeaf45a9f6f0e584..400cd984d97646f2f27aecba68f98f77391edf6e 100644 (file)
@@ -1,6 +1,6 @@
-USING: accessors help.lint.coverage help.lint.coverage.private
-help.markup help.syntax kernel literals math math.matrices
-sequences sorting tools.test vocabs ;
+USING: accessors fuel.help.private help.lint.coverage
+help.lint.coverage.private help.markup help.syntax kernel
+literals math math.matrices sequences sorting tools.test vocabs ;
 IN: help.lint.coverage.tests
 
 <PRIVATE
@@ -34,7 +34,7 @@ PRIVATE>
 { { $values $description $examples } } [ \ keep word-defines-sections ] unit-test
 { { $values $contract $examples } } [ \ <word-help-coverage> word-defines-sections ] unit-test
 
-{ eye } [ "eye" find-word ] unit-test
+{ empty } [ "empty" find-word ] unit-test
 
 {
   V{ "[" { $[ "math" dup lookup-vocab ] } "] " { "zero?" zero? } ": " }
index 90dbe518accb45c3fd380394fa966e891d67e9cf..ebb9ae53fdd5c41fd3eddbf0a1673ea880924410 100644 (file)
@@ -1,8 +1,9 @@
-USING: accessors arrays assocs classes classes.error combinators
-continuations english formatting fry generic help
-help.lint.checks help.markup io io.streams.string io.styles
-kernel math namespaces parser sequences sequences.deep sets
-sorting splitting strings summary vocabs vocabs.parser words ;
+USING: accessors arrays classes classes.error combinators
+combinators.short-circuit continuations english eval formatting
+fry fuel.help.private generic help help.lint help.lint.checks help.markup io
+io.streams.string io.styles kernel math namespaces parser
+prettyprint sequences sequences.deep sets sorting splitting strings summary
+vocabs words words.alias ;
 FROM: namespaces => set ;
 IN: help.lint.coverage
 
@@ -88,11 +89,15 @@ M: word-help-coverage summary
 
 : should-define ( word -- spec )
     {
-        { [ dup predicate? ]    [ drop { } ] } ! predicate?s have generated docs
-        { [ dup error-class? ]  [ drop { $values $description $error-description } ] }
-        { [ dup class? ]        [ drop { $class-description } ] }
-        { [ dup generic? ]      [ drop { $values $contract $examples } ] }
-        { [ dup word? ]         [ drop { $values $description $examples } ] }
+        ! predicates have generated docs
+        { [ dup predicate? ]   [ drop { } ] }
+        ! aliases should describe why they exist but ideally $values should be
+        ! automatically inherited from the aliased word's docs
+        { [ dup alias? ]       [ drop { $values $description } ] }
+        { [ dup error-class? ] [ drop { $values $description $error-description } ] }
+        { [ dup class? ]       [ drop { $class-description } ] }
+        { [ dup generic? ]     [ drop { $values $contract $examples } ] }
+        { [ dup word? ]        [ drop { $values $description $examples } ] }
         [ drop no-cond ]
     } cond ;
 
@@ -106,14 +111,6 @@ M: word-help-coverage summary
 
 : missing-sections ( word -- missing )
     [ should-define ] [ word-defines-sections ] bi diff ;
-
-: find-word ( name -- word/f )
-    dup words-named dup length {
-        { 0 [ 2drop f ] }
-        { 1 [ first nip ] }
-        [ drop <ambiguous-use-error> throw-restarts ]
-    } case ;
-
 PRIVATE>
 
 GENERIC: <word-help-coverage> ( word -- coverage )
@@ -153,3 +150,4 @@ M: word-help-coverage help-coverage.
 : word-help-coverage. ( word-spec -- ) <word-help-coverage> help-coverage. ;
 : vocab-help-coverage. ( vocab-spec -- ) <vocab-help-coverage> help-coverage. ;
 : prefix-help-coverage. ( prefix-spec private? -- ) <prefix-help-coverage> help-coverage. ;
+