clj-kondo

https://github.com/clj-kondo/clj-kondo
dave 2020-11-28T11:59:21.020600Z

hey there, i installed clj-kondo on a shared ubuntu server i don’t have sudo access to. the install seemed fine with using the —dir command but when i try to run it i get this error: clj-kondo: error while loading shared libraries: cannot make segment writable for relocation: Permission denied

borkdude 2020-11-28T12:01:01.021Z

@tech Maybe you could download the bash script and debug it: https://github.com/borkdude/clj-kondo/blob/master/script/install-clj-kondo

borkdude 2020-11-28T12:06:01.022600Z

All the installer does is basically download the zip file, extract it and put the binary on your path

dave 2020-11-28T12:06:03.022700Z

the install script worked ok... i was running just clj-kondo -h

dave 2020-11-28T12:06:17.022900Z

when i got the error

borkdude 2020-11-28T12:07:29.023200Z

oh, that's weird. I'm not sure what's going on there

dave 2020-11-28T12:08:49.024200Z

must be some directory it wants... not sure either. i can keep poking around at it

borkdude 2020-11-28T12:08:55.024400Z

@tech after some googling I found this: https://linux-tips.com/t/cannot-make-segment-writable-for-relocation-error/481

dave 2020-11-28T12:11:09.025100Z

oh interesting, doubt i will be able to run that since i don’t have sudo on this shared machine

borkdude 2020-11-28T12:11:36.025400Z

Maybe you can run clj-kondo via docker or via the JVM version

dave 2020-11-28T12:13:15.026Z

might be able to install a local JVM too with jenv

Ben Sless 2020-11-28T15:10:49.026800Z

Is there a way after writing hooks for a library to expose them to other kondo users who use macros the from my library?

borkdude 2020-11-28T15:12:01.027200Z

@ben.sless Yes. This is a new feature that's been implemented since the previous release: https://github.com/borkdude/clj-kondo/blob/master/doc/config.md#exporting-and-importing-configuration

Ben Sless 2020-11-28T15:12:30.027500Z

Excellent, thanks 🙏

2020-11-28T15:44:47.029Z

I'm trying to add the fulcro config. I followed the instructions at https://github.com/clj-kondo/config, but there is no .clj-kondo/configs/ folder present after the clojure -A:clj-kondo/config --lib fulcro command appears to complete successfully.

borkdude 2020-11-28T15:47:17.029500Z

@randumbo Did you have a .clj-kondo directory prior to that?

2020-11-28T15:47:32.029800Z

Yes, I did.

borkdude 2020-11-28T15:51:41.029900Z

OK, I see there's a bug in there. Let me fix it

borkdude 2020-11-28T15:52:49.030100Z

Fixed.

2020-11-28T15:57:48.030300Z

Thanks very much. Folder is there now. I still see warnings show up in places like defmutation, where it shows error| unresolved symbol action and other similar warnings. My understanding was that adding the fulcro configs should eliminate some or all of those warnings.

borkdude 2020-11-28T15:59:40.030500Z

Ah. Currently the fulcro support is a bit sparse. It only contains:

{:lint-as {com.fulcrologic.fulcro.components/defsc clojure.core/defn}}

borkdude 2020-11-28T16:01:04.030700Z

But the config lib is open for contributions so if more people find out the right config, everyone will profit.

borkdude 2020-11-28T16:01:17.030900Z

I'm not using fulcro myself at the moment, so I have no idea how the API works

2020-11-28T16:02:27.031100Z

Got it. Appreciate the help. I think I saw a few mentions in the Fulcro docs about setting this sort of thing up in Cursive. I'll see if I can copy it over.

borkdude 2020-11-28T16:03:50.031300Z

People could also contribute the config to fulcro itself. It can then be imported from the classpath: https://github.com/borkdude/clj-kondo/blob/master/doc/config.md#exporting-and-importing-configuration

2020-11-28T16:39:26.033Z

Is there a good way to configure as-> to not trigger an error? I’ve tried {:lint-as {clojure.core/as-> clojure.core/->}} but it still flags the first are to as-> as an unresolved symbol.

borkdude 2020-11-28T16:42:41.033500Z

@jkrasnay as-> should be fully supported. can you please post a repro of the your problem as a standalone example?

borkdude 2020-11-28T16:43:09.033800Z

Also please specify which version of clj-kondo you are using

2020-11-28T16:45:34.034400Z

Oh, I had the args to as-> reversed 😊 .

2020-11-28T16:47:12.034900Z

clj-kondo, just doin’ its job!

1