(analysis-skipped-result ns-sym source-file source-form e lang)Inputs: [ns-sym :- (s/maybe s/Symbol) source-file source-form e :- Throwable lang :- (s/enum :clj :cljs :both)] Returns: s/Any
Inputs: [ns-sym :- (s/maybe s/Symbol) source-file source-form e :- Throwable lang :- (s/enum :clj :cljs :both)] Returns: s/Any
(analyzed-def-entry ns-sym analyzed)Inputs: [ns-sym :- (s/maybe s/Symbol) analyzed :- aas/AnnotatedNode] Returns: (s/maybe PipelineDefEntry)
Inputs: [ns-sym :- (s/maybe s/Symbol) analyzed :- aas/AnnotatedNode] Returns: (s/maybe PipelineDefEntry)
(check-namespace project-state ns-sym source-file form-opts)Inputs: [project-state ns-sym :- s/Symbol source-file form-opts] Returns: s/Any
Owns the full per-namespace run: :load (require), :declaration + :read + :expression (typed declarations and form checking). Returns {:results [...] :provenance {sym → Provenance}}.
Inputs: [project-state ns-sym :- s/Symbol source-file form-opts]
Returns: s/Any
Owns the full per-namespace run: :load (require), :declaration + :read + :expression
(typed declarations and form checking). Returns
{:results [...] :provenance {sym → Provenance}}.(check-ns project-state ns source-file form-opts)Inputs: [project-state ns :- s/Symbol source-file form-opts] Returns: s/Any
Inputs: [project-state ns :- s/Symbol source-file form-opts] Returns: s/Any
(check-resolved-form
dict
ignore-body
ns-sym
source-file
source-form
analyzed
{:keys [keep-empty remove-context debug] :or {keep-empty false} :as opts})Inputs: [dict ignore-body :- #{s/Symbol} ns-sym :- s/Symbol source-file source-form analyzed :- aas/AnnotatedNode {:keys [keep-empty remove-context debug], :or {keep-empty false}, :as opts} :- copts/FormCheckOpts] Returns: s/Any
Inputs: [dict ignore-body :- #{s/Symbol} ns-sym :- s/Symbol source-file source-form analyzed :- aas/AnnotatedNode {:keys [keep-empty remove-context debug], :or {keep-empty false}, :as opts} :- copts/FormCheckOpts]
Returns: s/AnyShape of a single cached CLJS form entry under cljs-state[source-file] :entries.
Shape of a single cached CLJS form entry under `cljs-state[source-file] :entries`.
(def-output-results dict ns-sym source-file source-form enclosing-form node)Inputs: [dict ns-sym source-file source-form enclosing-form node :- aas/AnnotatedNode] Returns: s/Any
Inputs: [dict ns-sym source-file source-form enclosing-form node :- aas/AnnotatedNode] Returns: s/Any
(enclosing-form ns-sym source-form)Inputs: [ns-sym :- (s/maybe s/Symbol) source-form] Returns: s/Any
Inputs: [ns-sym :- (s/maybe s/Symbol) source-form] Returns: s/Any
(expression-exception-result ns-sym source-file source-form e lang)Inputs: [ns-sym :- (s/maybe s/Symbol) source-file source-form e :- Throwable lang :- (s/enum :clj :cljs :both)] Returns: s/Any
Inputs: [ns-sym :- (s/maybe s/Symbol) source-file source-form e :- Throwable lang :- (s/enum :clj :cljs :both)] Returns: s/Any
A literal value extracted from a ValueT Type's :value slot — i.e., the
finite values a Skeptic-known function can return when its output type is a
union of s/eq/:= constants. The realistic dispatch case is enum-like
primitives. Extending to collection-valued literals ((s/eq [:a :b]))
requires adding the collection variant here, not widening callers to
s/Any.
A literal value extracted from a `ValueT` Type's `:value` slot — i.e., the finite values a Skeptic-known function can return when its output type is a union of `s/eq`/`:=` constants. The realistic dispatch case is enum-like primitives. Extending to collection-valued literals (`(s/eq [:a :b])`) requires adding the collection variant here, not widening callers to `s/Any`.
(input-cast-result enclosing-form node error-groups)Inputs: [enclosing-form node :- aas/AnnotatedNode error-groups] Returns: s/Any
Inputs: [enclosing-form node :- aas/AnnotatedNode error-groups] Returns: s/Any
(input-error-group expr arg-node expected actual)Inputs: [expr arg-node :- (s/maybe aas/AnnotatedNode) expected :- at/SemanticType actual :- at/SemanticType] Returns: s/Any
Inputs: [expr arg-node :- (s/maybe aas/AnnotatedNode) expected :- at/SemanticType actual :- at/SemanticType] Returns: s/Any
(lang-of-source-file source-file)(lang-of-source-file opts source-file).cljs → :cljs. .cljc → :both. Anything else (.clj or no source-file) → :clj.
Two-arity form applies :cljs-disable (set unless --cljs-enable was
passed): :cljs and :both collapse to
:clj (i.e. drop the :cljs reader-conditional branch from .cljc).
Pure .cljs files are expected to be filtered at the discovery layer in
core/check-project before reaching here.
`.cljs` → :cljs. `.cljc` → :both. Anything else (.clj or no source-file) → :clj. Two-arity form applies `:cljs-disable` (set unless `--cljs-enable` was passed): `:cljs` and `:both` collapse to `:clj` (i.e. drop the `:cljs` reader-conditional branch from `.cljc`). Pure `.cljs` files are expected to be filtered at the discovery layer in `core/check-project` before reaching here.
(load-exception-result ns-sym e)Inputs: [ns-sym :- s/Symbol e :- Throwable] Returns: s/Any
Inputs: [ns-sym :- s/Symbol e :- Throwable] Returns: s/Any
(match-s-exprs enclosing-form node keep-empty)Inputs: [enclosing-form node :- aas/AnnotatedNode keep-empty :- s/Bool] Returns: s/Any
Inputs: [enclosing-form node :- aas/AnnotatedNode keep-empty :- s/Bool] Returns: s/Any
(method-output-type method)Inputs: [method :- aas/AnnotatedNode] Returns: at/SemanticType
Inputs: [method :- aas/AnnotatedNode] Returns: at/SemanticType
Output of pipeline-local analyzed-def-entry and input/output of
enrich-summary-with-declared-output. The :entry field reuses the
strict aapi/AnalyzedDefEntry, so :entry's :type is mandatory.
Output of pipeline-local `analyzed-def-entry` and input/output of `enrich-summary-with-declared-output`. The `:entry` field reuses the strict `aapi/AnalyzedDefEntry`, so `:entry`'s `:type` is mandatory.
(preload-clj-state! conn loaded verbose?)Analyze every clj/cljc source-file via the WORKER's streaming
analyze-namespaces-stream op. As each namespace's complete entries arrive,
immediately reattach metadata, build ns-entries and discovery. A namespace
discovered from more than one file is flagged on the wire so the worker can
report files the project's own load does not select (:shadowed-files,
source-file → {:ns :defined-by}). Returns
{:clj-state :clj-load-failures :ns-entries-map :project-disc :shadowed-files}. Empty when conn is nil. Under verbose?, each
:starting? reply prints a [skeptic analyze clj] marker — last marker
printed names the namespace whose require/macroexpansion blocked if the
worker hangs.
Analyze every clj/cljc source-file via the WORKER's streaming
analyze-namespaces-stream op. As each namespace's complete entries arrive,
immediately reattach metadata, build ns-entries and discovery. A namespace
discovered from more than one file is flagged on the wire so the worker can
report files the project's own load does not select (`:shadowed-files`,
source-file → {:ns :defined-by}). Returns
`{:clj-state :clj-load-failures :ns-entries-map :project-disc
:shadowed-files}`. Empty when `conn` is nil. Under `verbose?`, each
`:starting?` reply prints a `[skeptic analyze clj]` marker — last marker
printed names the namespace whose `require`/macroexpansion blocked if the
worker hangs.(preload-cljs-state! cljs-disable? conn loaded verbose?)Parse and analyze every source-file requiring cljs analysis (.cljs or
.cljc). Files are analyzed in dependency order against a single shared
cljs compiler state, so each file's [::namespaces <name>] entry is
already present when later files' macros introspect it at expansion
time (e.g. cljs.test/run-tests calling ana-api/find-ns). Cycles fall
back to the topo tiebreaker (see skeptic.cljs.topo).
Returns {:cljs-state {File → {:ns-ast :entries :asts}} :cljs-load-failures {File → {:exception Throwable}}} —
files whose cljs analyzer-driver pass throws (e.g. malformed ns form,
parse-ns failure) are recorded in :cljs-load-failures rather than
aborting the preload. Both maps are empty when cljs-disable? is
truthy or loaded contains no cljs/cljc sources. The shared state
is created here and discarded on return; downstream phases consume
only cached entries.
Parse and analyze every source-file requiring cljs analysis (.cljs or
.cljc). Files are analyzed in dependency order against a single shared
cljs compiler state, so each file's `[::namespaces <name>]` entry is
already present when later files' macros introspect it at expansion
time (e.g. cljs.test/run-tests calling ana-api/find-ns). Cycles fall
back to the topo tiebreaker (see `skeptic.cljs.topo`).
Returns `{:cljs-state {File → {:ns-ast :entries :asts}}
:cljs-load-failures {File → {:exception Throwable}}}` —
files whose cljs analyzer-driver pass throws (e.g. malformed ns form,
parse-ns failure) are recorded in `:cljs-load-failures` rather than
aborting the preload. Both maps are empty when `cljs-disable?` is
truthy or `loaded` contains no cljs/cljc sources. The shared state
is created here and discarded on return; downstream phases consume
only cached entries.(process-stream-reply clj-state-a
clj-failures-a
ns-entries-a
project-disc-a
shadowed-a
loaded-index
reply)Handle one intermediate reply from the streaming worker op. Reattaches
entry metadata, stores in clj-state, builds ns-entries and discovery
for that namespace. A :shadowed-by reply (the loaded runtime says
another file defines this namespace) is recorded in shadowed-a and
contributes no entries: its text is not the namespace's definition.
Mutates the accumulators in place (atoms). Replies are correlated by
:source-file — one namespace may arrive from several files, and each
file's reply must land on its own clj-state entry.
Handle one intermediate reply from the streaming worker op. Reattaches entry metadata, stores in clj-state, builds ns-entries and discovery for that namespace. A `:shadowed-by` reply (the loaded runtime says another file defines this namespace) is recorded in `shadowed-a` and contributes no entries: its text is not the namespace's definition. Mutates the accumulators in place (atoms). Replies are correlated by `:source-file` — one namespace may arrive from several files, and each file's reply must land on its own clj-state entry.
(project-state opts all-discovered-nss)Inputs: [opts all-discovered-nss :- copts/DiscoveredNamespaces] Returns: s/Any
Source-of-truth for the project pass: per-ns admission once, dicts merged into a project-wide dict; accessor summaries collected per-ns against the merged dict; conditional descriptors enriched once on the merged dict. Returns {:dict <enriched-merged> :accessor-summaries <merged> :per-ns {ns-sym {:ignore-body :errors :provenance}}}. Threaded into every per-namespace check so cross-namespace var resolution and conditional discriminators ride the same project pass.
all-discovered-nss MUST be the complete discovered namespace map for the
project, not a subset. Pre-filtering it by :namespace / -n silently
drops cross-namespace declarations: call sites in the requested namespace
that depend on schemas declared elsewhere would fall back to Dyn and
produce no finding. -n is a CHECKING filter and must be applied in
skeptic.core/check-project against the per-ns iteration loop, never
here.
When loaded includes .cljs or .cljc source-files, each is read and
analyzed independently via the cljs analyzer driver and the results are
carried as a local cljs-state map (source-file → {:ns-ast :entries :asts}) — threaded into per-ns admission/checking and stored on the
returned ProjectState. Per-ns admission/analysis dispatches on the
per-source-file lang carried in each loaded triple.
Inputs: [opts all-discovered-nss :- copts/DiscoveredNamespaces]
Returns: s/Any
Source-of-truth for the project pass: per-ns admission once, dicts merged
into a project-wide dict; accessor summaries collected per-ns against the
merged dict; conditional descriptors enriched once on the merged dict.
Returns {:dict <enriched-merged> :accessor-summaries <merged>
:per-ns {ns-sym {:ignore-body :errors :provenance}}}.
Threaded into every per-namespace check so cross-namespace var resolution
and conditional discriminators ride the same project pass.
`all-discovered-nss` MUST be the complete discovered namespace map for the
project, not a subset. Pre-filtering it by `:namespace` / `-n` silently
drops cross-namespace declarations: call sites in the requested namespace
that depend on schemas declared elsewhere would fall back to Dyn and
produce no finding. `-n` is a CHECKING filter and must be applied in
`skeptic.core/check-project` against the per-ns iteration loop, never
here.
When `loaded` includes `.cljs` or `.cljc` source-files, each is read and
analyzed independently via the cljs analyzer driver and the results are
carried as a local `cljs-state` map (source-file → `{:ns-ast :entries
:asts}`) — threaded into per-ns admission/checking and stored on the
returned `ProjectState`. Per-ns admission/analysis dispatches on the
per-source-file `lang` carried in each `loaded` triple.(read-exception-result source-file lang e)Inputs: [source-file lang :- (s/enum :clj :cljs) e :- Throwable] Returns: s/Any
Inputs: [source-file lang :- (s/enum :clj :cljs) e :- Throwable] Returns: s/Any
(reattach-entry-meta {:keys [source-form source-form-meta ast ast-form-meta
exception-class exception-message exception-data]
:as entry})Replay the sibling meta vectors the worker shipped (form metadata cannot ride
as ordinary collection metadata) back onto an entry's :source-form and :ast, then drop
the -meta carriers so the stored entry keeps its {:source-form :ast}
shape. See skeptic.worker.wire/apply-form-meta.
When the worker shipped a per-form :exception-class/:exception-message
(best-effort recovery, project-faithful-load), reconstruct a Throwable
tagged with :clojure.error/phase :macroexpansion so the existing
analyzer-failure-result routing demotes the offending form to Dyn via
analysis-skipped-result.
Replay the sibling meta vectors the worker shipped (form metadata cannot ride
as ordinary collection metadata) back onto an entry's `:source-form` and `:ast`, then drop
the `-meta` carriers so the stored entry keeps its `{:source-form :ast}`
shape. See `skeptic.worker.wire/apply-form-meta`.
When the worker shipped a per-form `:exception-class`/`:exception-message`
(best-effort recovery, project-faithful-load), reconstruct a Throwable
tagged with `:clojure.error/phase :macroexpansion` so the existing
`analyzer-failure-result` routing demotes the offending form to Dyn via
`analysis-skipped-result`.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 |