Liking cljdoc? Tell your friends :D

com.blockether.vis.internal.doctor

Doctor protocol: aggregates :ext/doctor-fn from every registered extension into a single cross-cutting diagnostic surface. vis doctor invokes run-checks then format-output + exit-code.

Plan §1 Q19 + §10:

  • One fn per extension. The fn returns a seq of message maps; the extension self-stamps :check-id on each message when it wants the formatter's per-section prefix.
  • Output ordering: extensions in registration order; messages in fn-return order. Levels NOT re-sorted within a section - cause-and-effect narrative preserved.
  • Activation contract: the fn runs for EVERY registered extension regardless of :ext/activation-fn. Doctor fns must defensively handle missing env keys.
  • Exit codes: 0 if only :info or empty; 1 if any :warn (no :error); 2 if any :error.
  • TTY-detected ANSI colors. UTF-8 icons by default.
Doctor protocol: aggregates `:ext/doctor-fn` from every
registered extension into a single cross-cutting diagnostic
surface. `vis doctor` invokes [[run-checks]] then
[[format-output]] + [[exit-code]].

Plan §1 Q19 + §10:
  - One fn per extension. The fn returns a seq of message maps;
    the extension self-stamps `:check-id` on each message when it
    wants the formatter's per-section prefix.
  - Output ordering: extensions in registration order; messages
    in fn-return order. Levels NOT re-sorted within a section -
    cause-and-effect narrative preserved.
  - Activation contract: the fn runs for EVERY registered
    extension regardless of `:ext/activation-fn`. Doctor fns must
    defensively handle missing env keys.
  - Exit codes: 0 if only :info or empty; 1 if any :warn (no
    :error); 2 if any :error.
  - TTY-detected ANSI colors. UTF-8 icons by default.
raw docstring

exit-codeclj

(exit-code messages)

Compute the doctor exit code from a vec of messages. 0 / 1 / 2 by max level. Plan Q19/d2.

Compute the doctor exit code from a vec of messages. 0 / 1 / 2 by
max level. Plan Q19/d2.
sourceraw docstring

format-outputclj

(format-output messages)
(format-output messages {:keys [use-ansi?]})

Build the full TTY output from a vec of messages. Empty result prints a placeholder. Caller routes it to stdout. ANSI is auto-detected; pass :use-ansi? to override.

Build the full TTY output from a vec of messages. Empty result
prints a placeholder. Caller routes it to stdout. ANSI is
auto-detected; pass `:use-ansi?` to override.
sourceraw docstring

run-checksclj

(run-checks environment)

Walk every registered extension, invoke its :ext/doctor-fn, return a vec of message maps with :ext auto-injected. The extension's fn is responsible for stamping :check-id on each message when it wants per-section grouping in the formatter.

Plan §10: extensions in registration order; messages in fn-return order. Activation-fn ignored: every registered extension's fn runs.

Walk every registered extension, invoke its `:ext/doctor-fn`,
return a vec of message maps with `:ext` auto-injected. The
extension's fn is responsible for stamping `:check-id` on each
message when it wants per-section grouping in the formatter.

Plan §10: extensions in registration order; messages in fn-return
order. Activation-fn ignored: every registered extension's fn runs.
sourceraw docstring

startup-hint-lineclj

(startup-hint-line)
(startup-hint-line environment)

Return a single-line string like ⚠ vis: 2 issues detected - run \bin/vis doctor` for details.when warn/error count > 0; nil otherwise. Caller decides whether to print (skipped when the command being dispatched ISvis doctor`).

Return a single-line string like `⚠ vis: 2 issues detected - run
\`bin/vis doctor\` for details.` when warn/error count > 0;
nil otherwise. Caller decides whether to print (skipped when the
command being dispatched IS `vis doctor`).
sourceraw docstring

cljdoc builds & hosts documentation for Clojure/Script libraries

Keyboard shortcuts
Ctrl+kJump to recent docs
Move to previous article
Move to next article
Ctrl+/Jump to the search field
× close