Fork me on GitHub
#clj-kondo
<
2019-07-27
>
borkdude08:07:03

@lee It's interesting that so far nobody has asked for this. Also it's a relative new feature in joker (a couple of years after people having used it). I really wonder if it's a good idea. I posted a Tweet about it: https://twitter.com/borkdude/status/1155024640231780352 Let's see what others think too.

borkdude08:07:58

I personally lean towards: if you do it for documentation only, use other means

sogaiu09:07:44

i think the spec alternative may be more attractive once it actually isn't alpha 🙂

lee14:07:20

Maybe the people who employ unused destructured keys for docs are not using clj-kondo yet? Even if the community unanimously agrees this practice is a bad (or questionable), clj-kondo still might be gracious and offer an option to ignore this specific practice to allow folks to transition to an alternative style at their own pace.

lee14:07:43

Of course this graciousness is not free, someone has to implement and then maintain it!

borkdude15:07:56

> I never destructure :keys just for documentation; the alternatives you mentioned both sound better. I do often add the :as part without using it, but i'm sure there is no perf penalty in that case. https://ask.clojure.org/index.php/8214/is-keys-destructuring-for-documentation-reasons-good-style?show=8217#a8217

crispin17:07:18

I've started using clj-kondo with flycheck, and there are places where the destructuring :keys are reported as unused bindings where they are basically documentation. They are more reminders to me, and I may use them on the inner expressions at some point. Some I've removed, but some I just leave. When I leave them it's nice to have the unused ones just underlined for me. So even if it is a form of documentation, when it's editor integrated like this, it's nice to have it highlighted. Just because a linter marks it, doesn't mean I have to alter it. So I like it the way it is. I can see how it might be annoying from the command line, but inside the editor it's kind of nice. Maybe for people using this as a form of documentation/reminder could consider using an editor integration?

borkdude17:07:24

You can also switch to :arglists for the functions that need docs

lee20:07:59

@borkdude, current release of clj-kondo is having difficulty with https://github.com/cljdoc/cljdoc/blob/d54cb58b20d2b4cb1e7c714b3637aa8b89956ce0/test/cljdoc/util_test.clj#L28 clj-kondo returns: test/cljdoc/util_test.clj:0:0: error: can't parse test/cljdoc/util_test.clj, Invalid symbol: org/clojure/math.numeric-tower. I can easily work around this for my purposes but I thought you’d like to know. Happy to raise a git issue if one is merited.

borkdude21:07:10

@lee issue would be fine

borkdude21:07:11

you'll probably also run into this one with rewrite-cljc, as this is a tools.reader issue

borkdude21:07:37

I have hacked around this for some other issue, I think it was a similar one for keywords

lee21:07:07

thanks, I shall make a note of that!

lee22:07:16

wooo! :analysis = import-vars smart?

sogaiu23:07:01

is there a straight-forward way to figure out the full path of the file that corresponds to a particular namespace?

lee23:07:04

hi @sogaiu! with regards to analysis?