4 Library
| (require dover) | package: dover-lib |
The dover module provides the functions that raco dover check is built on.
struct
(struct binding ( module id kind source-module source-id source-pkg exporters doc-modules)) module : module-path? id : symbol? kind : (or/c 'value 'syntax) source-module : module-path? source-id : symbol? source-pkg : (or/c string? #f) exporters : (listof exporter?) doc-modules : (or/c (listof module-path?) #f)
A binding, identified by where it is defined. The module and id fields give the
module it is reported under (see Where bindings are reported) and its name there. The
source-module and source-id fields give the module where it is defined and its
name there, and source-pkg names the package containing source-module, or is
#f for Racket’s main collections. The exporters field lists every checked module
that exports the binding.
The doc-modules field is #f if the binding is missing. Otherwise it lists the modules that the documentation says export the binding.
struct
module : module-path? id : symbol? via : (listof (cons/c module-path? symbol?)) documented? : boolean?
A checked module’s export of a binding, under the name id. A module that exports a binding
under more than one name has an exporter for each name. The via field lists the
modules, and the binding’s names in them, that the binding passes through between module
and the module that defines it. The documented? field says whether the binding, as
exported by module under id, connects to its documentation.
procedure
(binding-documented? b) → boolean?
b : binding?
struct
(struct module-coverage (module documented missing))
module : module-path? documented : (listof binding?) missing : (listof binding?)
struct
(struct doc-warning (binding module))
binding : binding? module : module-path?
struct
(struct unreachable-docs-warning doc-warning (id doc-id use-source))
id : symbol? doc-id : symbol? use-source : (or/c module-path? #f)
The warning’s binding is documented, but as exported by the warning’s module under the name
id, it doesn’t connect to its documentation. The doc-id field is the name the
documentation uses for the binding. The use-source field is a module on the binding’s
re-export path that exports it as doc-id, so that adding it to #:use-sources
would connect this export to the documentation, or #f if there is no such module.
struct
The documentation says the warning’s module exports its binding, but the module doesn’t.
struct
(struct coverage-report (scored unscored warnings errors))
scored : (listof module-coverage?) unscored : (listof module-coverage?) warnings : (listof doc-warning?) errors : (listof (cons/c module-path? string?))
The result of check-coverage. The scored field covers bindings defined in the
checked packages, and unscored covers bindings re-exported from other packages. The
warnings field holds the documentation warnings for scored bindings. The errors
field pairs each module that could not be loaded with its error message.
procedure
(package-modules pkg [ #:include-private? include-private?]) → (listof module-path?) pkg : string? include-private? : any/c = #f
Returns the modules in the installed package pkg, found as described in
Which modules are checked but without any of the configuration from "info.rkt" other than
compile-omit-paths. Modules in "private" directories are included only if
include-private? is true. The result is sorted so that each module comes before its
submodules and the modules nested under it.
procedure
(check-coverage mods #:packages pkgs [ #:ignore ignore]) → coverage-report? mods : (listof module-path?) pkgs : (listof string?) ignore : list? = '()
Checks the bindings exported by mods, declaring (but not instantiating) each module in a
fresh namespace. Bindings defined in one of pkgs are scored; see Which bindings count.
Each element of ignore has the same form as an element of dover-ignore.
procedure
mc : module-coverage?
Returns the number of bindings in mc, documented or not.
procedure
(coverage-ratio mcs) → (or/c (between/c 0 1) #f)
mcs : (listof module-coverage?)
Returns the fraction of the bindings in mcs that are documented, or #f if
mcs contains no bindings.