cljdoc

https://cljdoc.org/ & https://github.com/cljdoc/cljdoc
lread 2019-04-06T17:10:28.078Z

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

lread 2019-04-06T17:13:14.080600Z

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.

martinklepsch 2019-04-07T12:33:38.085600Z

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

lread 2019-04-07T14:07:31.089200Z

Ok, thanks!

lread 2019-04-06T17:15:04.082200Z

And… what is expectation for records? https://github.com/cljdoc/codox/blob/cljs-proper/codox/test-sources/codox_test/record.cljc

lread 2019-04-06T20:30:15.084Z

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

martinklepsch 2019-04-07T12:30:35.085300Z

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.

lread 2019-04-07T14:07:02.088800Z

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.

lread 2019-04-07T14:58:13.094400Z

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?

martinklepsch 2019-04-07T17:01:29.098Z

Yes, that's correct

martinklepsch 2019-04-07T17:01:46.098500Z

because bar is just like any other var

lread 2019-04-07T17:30:49.107400Z

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

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