final fixups

windows-high-dpi
Cat Stevens 2018-02-11 22:48:24 -05:00 committed by John Benediktsson
parent 3aee29e373
commit 52410dee2b
2 changed files with 20 additions and 22 deletions

View File

@ -1,6 +1,6 @@
USING: accessors help.lint.coverage help.lint.coverage.private USING: accessors fuel.help.private help.lint.coverage
help.markup help.syntax kernel literals math math.matrices help.lint.coverage.private help.markup help.syntax kernel
sequences sorting tools.test vocabs ; literals math math.matrices sequences sorting tools.test vocabs ;
IN: help.lint.coverage.tests IN: help.lint.coverage.tests
<PRIVATE <PRIVATE
@ -34,7 +34,7 @@ PRIVATE>
{ { $values $description $examples } } [ \ keep word-defines-sections ] unit-test { { $values $description $examples } } [ \ keep word-defines-sections ] unit-test
{ { $values $contract $examples } } [ \ <word-help-coverage> 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? } ": " } V{ "[" { $[ "math" dup lookup-vocab ] } "] " { "zero?" zero? } ": " }

View File

@ -1,8 +1,9 @@
USING: accessors arrays assocs classes classes.error combinators USING: accessors arrays classes classes.error combinators
continuations english formatting fry generic help combinators.short-circuit continuations english eval formatting
help.lint.checks help.markup io io.streams.string io.styles fry fuel.help.private generic help help.lint help.lint.checks help.markup io
kernel math namespaces parser sequences sequences.deep sets io.streams.string io.styles kernel math namespaces parser
sorting splitting strings summary vocabs vocabs.parser words ; prettyprint sequences sequences.deep sets sorting splitting strings summary
vocabs words words.alias ;
FROM: namespaces => set ; FROM: namespaces => set ;
IN: help.lint.coverage IN: help.lint.coverage
@ -88,7 +89,11 @@ M: word-help-coverage summary
: should-define ( word -- spec ) : should-define ( word -- spec )
{ {
{ [ dup predicate? ] [ drop { } ] } ! predicate?s have generated docs ! 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 error-class? ] [ drop { $values $description $error-description } ] }
{ [ dup class? ] [ drop { $class-description } ] } { [ dup class? ] [ drop { $class-description } ] }
{ [ dup generic? ] [ drop { $values $contract $examples } ] } { [ dup generic? ] [ drop { $values $contract $examples } ] }
@ -106,14 +111,6 @@ M: word-help-coverage summary
: missing-sections ( word -- missing ) : missing-sections ( word -- missing )
[ should-define ] [ word-defines-sections ] bi diff ; [ 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> PRIVATE>
GENERIC: <word-help-coverage> ( word -- coverage ) 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. ; : word-help-coverage. ( word-spec -- ) <word-help-coverage> help-coverage. ;
: vocab-help-coverage. ( vocab-spec -- ) <vocab-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. ; : prefix-help-coverage. ( prefix-spec private? -- ) <prefix-help-coverage> help-coverage. ;