Fork me on GitHub
#clj-kondo
<
2020-01-22
>
bfabry15:01:34

idea: inspection that warns about a function definition without ! at the end of the name that includes a call to a function with ! at the end of the name in the body

eraserhd20:01:40

I don't think ! has a consistent meaning in Clojure.

eraserhd20:01:55

Also, it's possible for a function to be pure even though it mutates things. e.g. a function which uses transients for performance but returns the persistent collection.

bfabry20:01:17

ah, that is a good point

eraserhd21:01:08

idea: warn when two files require a namespace with different aliases?

dominicm08:01:19

I've mentioned this a few times, I have a plan to write something that will rewrite your project into consistency automatically

dominicm08:01:48

I want a few other pieces in place first, namely alignment of forms needs careful preservation. Doing research into that now :)

sfyire21:01:23

Is there an exception for js/ in cljs?

borkdude21:01:05

@eraserhd That feature is already in clj-kondo: https://github.com/borkdude/clj-kondo/blob/master/doc/config.md#alias-consistency Although you have to decide on one accepted alias using the config before you get a warning. The analysis output can also help to detect difference and to create the initial config.

borkdude21:01:42

@sfyire Are you sure that's not a cljc file? Can't reproduce it.

sfyire21:01:49

@borkdude oh weird I get it for https://github.com/roman01la/proton-native-cljs using atom and the linter-kondo plugin (inside core.cljs)

borkdude21:01:45

@aviflax was going to do a PR to fix this I believe. it's doesn't pass the --lang flag so clj-kondo doesn't know this is cljs

borkdude21:01:50

it seems the commit is already in there, so maybe try upgrading the plugin @sfyire? https://github.com/gerred/linter-kondo/blob/master/index.js

borkdude21:01:32

or maybe it hasn't been released yet. anyway, that's the issue

sfyire21:01:20

@borkdude oh I see that might be why I don't see that error in cursive, looks like they haven't tagged up a release yet in linter-kondo, good to know it's incoming though

borkdude21:01:51

might be worth asking the maintainer(s) directly

gerred21:01:33

PR me! ๐Ÿ™‚ I'm underwater with work right now.

gerred21:01:38

or open an issue and I can look in the next few days

gerred22:01:28

one sec, on a call then I'll review. do I need to cut a release?

borkdude22:01:12

@gerred avi mentioned: > but first one of us should test this change in the last comment of that issue. ๐Ÿ™‚

borkdude22:01:50

maybe there's also a way for people to build the plugin locally to test it out

sfyire22:01:37

I have an example of a failing test case but not sure how to build the plugin locally, will do some googling

sfyire22:01:06

ok so I've uninstalled the existing plugin, done git clone ~/.atom/package/linter-kondo/ and I can see the plugin in atom's list

sfyire22:01:32

now there's no error but also don't see anything when adding (inc "test") so I think I may have done something wrong

sfyire22:01:40

I did see other people talking about using apm link

sfyire22:01:16

ah figured out why, I usually disable toasts but it does hide important stuff:

borkdude22:01:51

maybe someone in the #atom-editor channel knows how to build such a thing?

sfyire22:01:53

this isn't a bug in the linter it's something I've done to try and load it in dev mode

borkdude22:01:58

oh, only 16 people there

borkdude22:01:18

good luck, I'm afk now

sfyire22:01:23

ok I've figured out a couple of things, the above error I needed to npm i but I'm still not seeing anything when I console log that line I get:

sfyire22:01:21

looks like clj-kondo expects cljs instead of .cljs for that argument, I've "fixed" that locally but that doesn't appear to have fixed it

borkdude22:01:36

it's supposed to be --lint - --lang cljs so it's also the wrong order

sfyire22:01:51

good spot that's working in a local hack

sfyire22:01:47

@gerred I think this might be what we're after: https://github.com/gerred/linter-kondo/pull/3

gerred23:01:46

@sfyire thank you! Still on this call ๐Ÿ™„ then I'll look and merge, and throw you a commit bit.

aviflax23:01:02

Ah, sorryโ€ฆ I meant to look into how to test that change but I havenโ€™t gotten around to it