Static ns form parsing and dependency graph construction. Parses ns forms using clojure.core/read (no eval, no external deps) and builds a directed dependency graph.
Static ns form parsing and dependency graph construction. Parses ns forms using clojure.core/read (no eval, no external deps) and builds a directed dependency graph.
(affected-test-nss graph changed-ns-syms test-ns-syms)Given the dependency graph, a set of changed namespace symbols, and a set of known test namespace symbols, returns only those test namespaces that are transitively affected by the changes.
Given the dependency graph, a set of changed namespace symbols, and a set of known test namespace symbols, returns only those test namespaces that are transitively affected by the changes.
(build-graph src-dirs test-dirs)Scans all .clj files in the given source and test directories. Parses ns forms and returns a DependencyGraph: {:nodes #{ns-symbols...} :edges {ns-sym #{dep-ns-sym...}}}
Scans all .clj files in the given source and test directories.
Parses ns forms and returns a DependencyGraph:
{:nodes #{ns-symbols...} :edges {ns-sym #{dep-ns-sym...}}}(build-graph-for-platform src-dirs test-dirs platform)Like build-graph, but dispatches file discovery by platform (:clj or :cljs).
Like build-graph, but dispatches file discovery by platform (:clj or :cljs).
(build-graph-from-parsed parsed-seq)Builds a DependencyGraph from a seq of parsed ns-form maps ({:ns-sym <symbol> :deps #{<dep-symbols>}}). Returns {:nodes #{ns-symbols...} :edges {ns-sym #{dep-ns-sym...}}}
Builds a DependencyGraph from a seq of parsed ns-form maps
({:ns-sym <symbol> :deps #{<dep-symbols>}}).
Returns {:nodes #{ns-symbols...} :edges {ns-sym #{dep-ns-sym...}}}(parse-ns-form file-path)Reads the first form from a .clj file. If it is an ns form, returns {:ns-sym <symbol> :deps #{<dep-symbols>}}. Otherwise returns nil. Uses clojure.core/read — no code is evaluated.
Reads the first form from a .clj file. If it is an ns form, returns
{:ns-sym <symbol> :deps #{<dep-symbols>}}. Otherwise returns nil.
Uses clojure.core/read — no code is evaluated.(reverse-edges graph)Inverts the dependency graph: for each edge A -> B (A depends on B), produces B -> A (B is depended-on by A). This lets us walk from a changed namespace to all its dependents.
Inverts the dependency graph: for each edge A -> B (A depends on B), produces B -> A (B is depended-on by A). This lets us walk from a changed namespace to all its dependents.
(transitive-dependents graph changed-ns-syms)Given a graph and a set of changed namespace symbols, returns the full set of transitively affected namespaces (including the changed ones themselves). Uses BFS over the reversed dependency graph. Handles cycles safely.
Given a graph and a set of changed namespace symbols, returns the full set of transitively affected namespaces (including the changed ones themselves). Uses BFS over the reversed dependency graph. Handles cycles safely.
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 |