(analyse ns {:keys [output sorted] :as params} lookup project)
seed analyse function for the code.manage/analyse
task
(->> (project/in-context (analyse 'code.framework-test)) (common/display-entry)) => (contains-in {:test {'code.framework (contains '[analyse analyse-file analyse-source-code])}})
(->> (project/in-context (analyse 'code.framework)) (common/display-entry)) => (contains-in {:source {'code.framework (contains '[analyse analyse-file analyse-source-code])}})
seed analyse function for the `code.manage/analyse` task (->> (project/in-context (analyse 'code.framework-test)) (common/display-entry)) => (contains-in {:test {'code.framework (contains '[analyse analyse-file analyse-source-code])}}) (->> (project/in-context (analyse 'code.framework)) (common/display-entry)) => (contains-in {:source {'code.framework (contains '[analyse analyse-file analyse-source-code])}})
(analyse-file [type path])
helper function for analyse, taking a file as input
(analyse-file [:source "src/code/framework.clj"])
helper function for analyse, taking a file as input (analyse-file [:source "src/code/framework.clj"])
(analyse-file-raw [type path])
helper function for code.framework/analyse-file
helper function for code.framework/analyse-file
(analyse-source-code s)
analyses a source file for namespace and function definitions
(-> (analyse-source-code (slurp "test-data/code.manage/src/example/core.clj")) (get-in '[example.core -foo-])) => '{:ns example.core, :var -foo-, :source {:code "(defn -foo-\n [x]\n (println x "Hello, World!"))", :line {:row 3, :col 1, :end-row 6, :end-col 31}, :path nil}}
analyses a source file for namespace and function definitions (-> (analyse-source-code (slurp "test-data/code.manage/src/example/core.clj")) (get-in '[example.core -foo-])) => '{:ns example.core, :var -foo-, :source {:code "(defn -foo-\n [x]\n (println x \"Hello, World!\"))", :line {:row 3, :col 1, :end-row 6, :end-col 31}, :path nil}}
(analyse-source-function nsp nav)
helper function for analyse-source-code
helper function for `analyse-source-code`
(analyse-test-code s)
analyses a test file for docstring forms
(-> (analyse-test-code (slurp "test-data/code.manage/test/example/core_test.clj")) (get-in '[example.core -foo-]) (update-in [:test :code] docstring/->docstring)) => (contains '{:ns example.core :var -foo- :test {:code "1\n => 1" :line {:row 6 :col 1 :end-row 7 :end-col 16} :path nil} :meta {:added "3.0"} :intro ""})
analyses a test file for docstring forms (-> (analyse-test-code (slurp "test-data/code.manage/test/example/core_test.clj")) (get-in '[example.core -foo-]) (update-in [:test :code] docstring/->docstring)) => (contains '{:ns example.core :var -foo- :test {:code "1\n => 1" :line {:row 6 :col 1 :end-row 7 :end-col 16} :path nil} :meta {:added "3.0"} :intro ""})
(compile-regex obj)
compiles a regex string from an input string
(compile-regex "(:require") => "\(:require"
compiles a regex string from an input string (compile-regex "(:require") => "\\(:require"
(docstrings ns {:keys [full sorted]} lookup project)
returns all docstrings in a given namespace with given keys
(->> (project/in-context (docstrings)) (map first) sort) => (project/in-context (vars {:sorted true}))
returns all docstrings in a given namespace with given keys (->> (project/in-context (docstrings)) (map first) sort) => (project/in-context (vars {:sorted true}))
(find-test-frameworks ns-form)
find test frameworks given a namespace form (find-test-frameworks '(ns ... (:use code.test))) => #{:fact}
(find-test-frameworks '(ns ... (:use clojure.test))) => #{:clojure}
find test frameworks given a namespace form (find-test-frameworks '(ns ... (:use code.test))) => #{:fact} (find-test-frameworks '(ns ... (:use clojure.test))) => #{:clojure}
(grep-replace ns
{:keys [print query replace] :as params}
lookup
{:keys [root] :as project})
replaces code based on string query
(project/in-context (grep-replace {:query "docstrings" :replace "[DOCSTRINGS]" :print {:function true}}))
replaces code based on string query (project/in-context (grep-replace {:query "docstrings" :replace "[DOCSTRINGS]" :print {:function true}}))
(grep-search ns
{:keys [print query] :as params}
lookup
{:keys [root] :as project})
finds code based on string query
(project/in-context (grep-search {:query '[docstrings] :print {:function true}}))
finds code based on string query (project/in-context (grep-search {:query '[docstrings] :print {:function true}}))
(import-selector)
(import-selector var)
creates an import selector
(import-selector '-hello-) ;;[(#{<options>} | -hello- string? map? & _)] => vector?
creates an import selector (import-selector '-hello-) ;;[(#{<options>} | -hello- string? map? & _)] => vector?
(locate-code ns
{:keys [print query] :as params}
lookup
{:keys [root] :as project})
finds code base upon a query
finds code base upon a query
(no-test ns params lookup project)
checks that a namespace does not require test
checks that a namespace does not require test
(read-ns-form path)
memoised version of fs/read-ns
memoised version of fs/read-ns
(read-ns-form-raw path)
helper function for code.framework/read-ns-form
helper function for code.framework/read-ns-form
(refactor-code ns {:keys [edits] :as params} lookup project)
takes in a series of edits and performs them on the code
(project/in-context (refactor-code {:edits []})) => {:changed [], :updated false, :path "test/code/framework_test.clj"}
takes in a series of edits and performs them on the code (project/in-context (refactor-code {:edits []})) => {:changed [], :updated false, :path "test/code/framework_test.clj"}
(search-regex obj)
constructs a search regex (for line numbers)
(search-regex "hello") => #"^(.*?)(hello)"
constructs a search regex (for line numbers) (search-regex "hello") => #"^(.*?)(hello)"
(toplevel-selector)
(toplevel-selector var)
creates a selector for querying toplevel forms
(toplevel-selector '-hello-) ;;[(#{<def forms>} | -hello- & _)] => vector?
creates a selector for querying toplevel forms (toplevel-selector '-hello-) ;;[(#{<def forms>} | -hello- & _)] => vector?
(transform-code ns
{:keys [write print skip transform full] :as params}
lookup
{:keys [root] :as project})
transforms the code and performs a diff to see what has changed
;; options include :skip, :full and :write (project/in-context (transform-code 'code.framework {:transform identity})) => (contains {:changed [] :updated false :path any})
transforms the code and performs a diff to see what has changed ;; options include :skip, :full and :write (project/in-context (transform-code 'code.framework {:transform identity})) => (contains {:changed [] :updated false :path any})
(var-function full)
constructs a var, with or without namespace
((var-function true) {:ns 'hello :var 'world}) => 'hello/world
((var-function false) {:ns 'hello :var 'world}) => 'world
constructs a var, with or without namespace ((var-function true) {:ns 'hello :var 'world}) => 'hello/world ((var-function false) {:ns 'hello :var 'world}) => 'world
(vars ns {:keys [full sorted] :as params} lookup project)
returns all vars in a given namespace (project/in-context (vars {:sorted true})) => (contains '[analyse analyse-file analyse-source-code analyse-source-function])
returns all vars in a given namespace (project/in-context (vars {:sorted true})) => (contains '[analyse analyse-file analyse-source-code analyse-source-function])
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close