Fork me on GitHub
#clojure-uk
<
2023-10-23
>
schmalz08:10:18

Morning all.

maleghast08:10:39

'Ello... How's everyone today?

seancorfield14:10:57

Awake earlier than usual (after being up later than usual!). Finally took a look at logseq last night... I've never been able to get into any of these note-taking programs so we'll see how it goes. I was also wrangling clj-kondo hooks for Expectations last night which got my mind spinning and woke me up early 🙂

clojure-spin 1
borkdude14:10:00

the latest nightly lsp contains a fix for the NPE

borkdude14:10:25

(which is in clj-kondo which was just bumped)

borkdude14:10:48

but still it might be better to not use def-catch-all for something it wasn't built for

borkdude14:10:16

{:config-in-call {foo/bar {:linters {:ignore true}}}}

borkdude14:10:30

is the better option, you can also provide :ignore [:linter1 :linter2]

seancorfield14:10:06

OK, will try that for defphraser once I've had a coffee... 🙂

seancorfield15:10:14

...confirmed that the NPE is gone 🙂 Updating that config now...

seancorfield15:10:13

Where should that :config-in-call go? I tried it in the main .clj-kondo/config.edn for the project and got a bunch of unresolved symbol errors from the defphraser calls that I don't get for def-catch-all.

borkdude15:10:30

yes, in .clj-kondo/config.edn, what does it look like now?

seancorfield15:10:49

Here's what I had (which "works"):

:lint-as
 {phrase.alpha/defphraser clj-kondo.lint-as/def-catch-all}
and I changed that to:
:config-in-call
 {phrase.alpha/defphraser {:linters {:ignore true}}}
and here the call:
(defphraser #(contains? % k)
  [_ _ k]
  (str (name k) " is required."))
and every k and _ has a red squiggly complaining "Unresolved symbol"

borkdude15:10:51

I'll try to repro...

borkdude16:10:31

ah, it should be:

:config-in-call {defphraser/defphraser {:ignore true}}

borkdude16:10:07

so without the :linters indirection

seancorfield16:10:24

Yup, that fixed it!

seancorfield16:10:09

VS Code's Explorer now shows no (lint) errors in our entire code base 🙂

✨ 1
seancorfield16:10:05

We have a couple of def-catch-all in the config... one is definitely a def-like thing... I'll have to look at the other one...

seancorfield16:10:26

If I want a specific (comment ..) form to not be linted...?

borkdude16:10:42

#_:clj-kondo/ignore
(comment x y z)

seancorfield16:10:24

Yup, just one. Thanks.

danielneal15:10:00

Nice! I’ve been a Notion fan until I discovered it doesn’t work offline. So experimenting with Logseq now, excited that its a clojure solution 🙂

seancorfield15:10:14

The only thing that's weird to me is that I'm so used to all my data being in the cloud that I don't know how I'll get on with a product that specifically uses local file storage!