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:
:check-id on each message when it
wants the formatter's per-section prefix.:ext/activation-fn. Doctor fns must
defensively handle missing env keys.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.(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.
(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.
(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.
(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`).
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |