Fork me on GitHub
#cljdoc
<
2019-04-06
>
lread17:04:28

Hi there @martinklepsch, I am building up some unit tests - when you have a moment I have a few questions. 🙂

lread17:04:14

I am looking at your playground test area under test-sources. I see stuff that is obviously useful for tests, but am unsure about other stuff. Like https://github.com/cljdoc/codox/blob/b29b16ae686e3400689bbdc93df57200b709443d/codox/test-sources/codox_test/macro.cljc#L11 this behaves differently under clj and cljs and am wondering if it merits an automated test of some sort.

martinklepsch12:04:38

These were created to reproduce one particular issue that ultimately didn't have to do anything with spec, don't recall the details right now but probably fine to ignore/delete for now

lread14:04:31

Ok, thanks!

lread20:04:15

For records, I think the intent might be to exclude them from docs (is this the config you use? https://github.com/cljdoc/cljdoc/blob/139a5a6c8094ef05cde24b93ef942b0882dbb22f/modules/analysis-runner/resources/impl.clj.tpl#L24). This does exclude them from Clojure but only partially excludes them from ClojureScript. This might be why I see a cljs only records up on cljdoc, for example: https://cljdoc.org/d/metosin/reitit-ring/0.3.1/api/reitit.coercion#CoercionError

martinklepsch12:04:35

For records we filter out the automatically generated constructor functions (->Record, map->Record), the record itself should be listed. That it is not in Clojure seems like a bug.

lread14:04:02

Thanks. Ah I got it backwards. Ok, I will see if there is a clear and easy fix, if not I will raise a separate git issue.

lread14:04:13

Oh wait... let me make sure I understand... So for

(defrecord Foo [a b])
(def bar (->Foo 1 2))
You would expect to see both Foo and bar in docs?

martinklepsch17:04:29

Yes, that's correct

martinklepsch17:04:46

because bar is just like any other var

lread17:04:49

Thanks, I think I got confused about which one was considered a record.

user=> (record? Foo)
false
user=> (record? bar)
true