diff --git a/.clj-kondo/imports/io.github.noahtheduke/lazytest/config.edn b/.clj-kondo/imports/io.github.noahtheduke/lazytest/config.edn index 1a5e422..8be9cc9 100644 --- a/.clj-kondo/imports/io.github.noahtheduke/lazytest/config.edn +++ b/.clj-kondo/imports/io.github.noahtheduke/lazytest/config.edn @@ -1,5 +1,6 @@ {:lint-as {lazytest.core/given clojure.core/let lazytest.core/around clojure.core/fn + lazytest.core/defdescribe clojure.core/def ;; clojure.test interface lazytest.experimental.interfaces.clojure-test/deftest clojure.test/deftest lazytest.experimental.interfaces.clojure-test/testing clojure.test/testing @@ -8,6 +9,5 @@ ;; xunit interface lazytest.experimental.interfaces.xunit/defsuite clojure.core/def } - :hooks {:analyze-call {lazytest.core/defdescribe hooks.lazytest-core/defdescribe - lazytest.core/defcontext hooks.lazytest-core/defdescribe - lazytest.core/defsuite hooks.lazytest-core/defdescribe}}} + :linters {:clojure-lsp/unused-public-var + {:exclude-when-defined-by #{lazytest.core/defdescribe}}}} diff --git a/.clj-kondo/imports/io.github.noahtheduke/lazytest/hooks/lazytest_core.clj b/.clj-kondo/imports/io.github.noahtheduke/lazytest/hooks/lazytest_core.clj deleted file mode 100644 index ae4e426..0000000 --- a/.clj-kondo/imports/io.github.noahtheduke/lazytest/hooks/lazytest_core.clj +++ /dev/null @@ -1,31 +0,0 @@ -(ns hooks.lazytest-core - (:require [clj-kondo.hooks-api :as api])) - -(defn get-arg - "Taken from lazytest.core" - [pred args] - (if (pred (first args)) - [(first args) (next args)] - [nil args])) - -(defn defdescribe - "Converts (defdescribe foo ...body) to (def foo (fn [] ...body))" - [{:keys [node] :as input}] - (let [[defdescribe-node name-node & body-nodes] (:children node) - [doc-node body-nodes] (get-arg api/string-node? body-nodes) - doc-node (or doc-node - (with-meta (api/string-node (str name-node)) - (meta name-node))) - new-node (with-meta - (api/list-node - [(with-meta (api/token-node 'clojure.core/def) - (meta defdescribe-node)) - name-node - doc-node - (api/list-node - (list* - (api/token-node 'clojure.core/fn) - (api/vector-node []) - body-nodes))]) - (meta node))] - (assoc input :node new-node))) diff --git a/CHANGELOG.md b/CHANGELOG.md index 504c35e..9673d31 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,8 @@ ### Added - Can now pass in paths as cli arguments, not just through repeated `--dir` flags: `clojure -M:dev:test test/unit test/integration` will look for tests in both `test/unit` and `test/integration`. +- Documentation in `docs/core.md` and in the `lazytest.core` docstring. +- Exclude `lazytest.core/defdescribe` from `:clojure-lsp/unused-public-var` linter. ### Changed @@ -20,6 +22,10 @@ is rewritten as `(expect (int? (+ 1 1)))`. - Switch from `:test` metadata to `:lazytest/test` metadata. It's longer, but it no longer clashes with `clojure.test`'s internals so you can run lazytest over `clojure.test` tests without them being marked as passing tests. (See [#4](https://github.com/NoahTheDuke/lazytest/issues/4).) +### Fixed + +- cljdoc links in README.md. (See [#1](https://github.com/NoahTheDuke/lazytest/issues/1).) + ## 1.3.0 Released `2024-10-21`. diff --git a/resources/clj-kondo.exports/io.github.noahtheduke/lazytest/config.edn b/resources/clj-kondo.exports/io.github.noahtheduke/lazytest/config.edn index 1a5e422..866d738 100644 --- a/resources/clj-kondo.exports/io.github.noahtheduke/lazytest/config.edn +++ b/resources/clj-kondo.exports/io.github.noahtheduke/lazytest/config.edn @@ -1,5 +1,6 @@ {:lint-as {lazytest.core/given clojure.core/let lazytest.core/around clojure.core/fn + lazytest.core/defdescribe clojure.core/def ;; clojure.test interface lazytest.experimental.interfaces.clojure-test/deftest clojure.test/deftest lazytest.experimental.interfaces.clojure-test/testing clojure.test/testing @@ -8,6 +9,7 @@ ;; xunit interface lazytest.experimental.interfaces.xunit/defsuite clojure.core/def } - :hooks {:analyze-call {lazytest.core/defdescribe hooks.lazytest-core/defdescribe - lazytest.core/defcontext hooks.lazytest-core/defdescribe - lazytest.core/defsuite hooks.lazytest-core/defdescribe}}} + :linters {:clojure-lsp/unused-public-var + {:exclude-when-defined-by #{lazytest.core/defdescribe + lazytest.experimental.interfaces.xunit/defsuite + lazytest.experimental.interfaces.clojure-test/deftest}}}} diff --git a/resources/clj-kondo.exports/io.github.noahtheduke/lazytest/hooks/lazytest_core.clj b/resources/clj-kondo.exports/io.github.noahtheduke/lazytest/hooks/lazytest_core.clj deleted file mode 100644 index ae4e426..0000000 --- a/resources/clj-kondo.exports/io.github.noahtheduke/lazytest/hooks/lazytest_core.clj +++ /dev/null @@ -1,31 +0,0 @@ -(ns hooks.lazytest-core - (:require [clj-kondo.hooks-api :as api])) - -(defn get-arg - "Taken from lazytest.core" - [pred args] - (if (pred (first args)) - [(first args) (next args)] - [nil args])) - -(defn defdescribe - "Converts (defdescribe foo ...body) to (def foo (fn [] ...body))" - [{:keys [node] :as input}] - (let [[defdescribe-node name-node & body-nodes] (:children node) - [doc-node body-nodes] (get-arg api/string-node? body-nodes) - doc-node (or doc-node - (with-meta (api/string-node (str name-node)) - (meta name-node))) - new-node (with-meta - (api/list-node - [(with-meta (api/token-node 'clojure.core/def) - (meta defdescribe-node)) - name-node - doc-node - (api/list-node - (list* - (api/token-node 'clojure.core/fn) - (api/vector-node []) - body-nodes))]) - (meta node))] - (assoc input :node new-node)))