Fork me on GitHub
#clj-kondo
<
2022-10-07
>
serioga10:10:47

@borkdude clj-kondo does not know about :include-macros require option (“Unknown require option: :include-macros”)? https://clojurescript.org/guides/ns-forms

(ns bar.core
  (:require [foo.core :as foo :include-macros true]))
should I file an issue?

borkdude10:10:13

@serioga Thank you. There is already an issue and PR for this, I will merge this soon

serioga10:10:47

@borkdude will it be accepted in CLJ files too? Or I shoud use reader conditionals in CLJC files? At least Clojure compiler does not complain about this option.

borkdude10:10:54

@serioga Good data point, thank you. If the Clojure compiler doesn't complain, then perhaps we should just let this slide inside a .cljc file

Noah Bogart11:10:02

Does clj-kondo know it’s in a cljc file? I thought it just ran twice, one for each dialect

borkdude11:10:26

Yes, it knows, in the context we have :base-lang and :lang. :base-lang can be :cljc

👍 1
Noah Bogart11:10:03

Cool, I’ll check for that. Will be on my computer and fix the pr in an hour or two.

serioga11:10:46

@nbtheduke Clojure does not complain about :include-macros in CLJ file too 🙂

borkdude12:10:00

Clojure doesn't complain about anything, but the point of that linter is to prevent typos by adding options that don't do anything

☝️ 1
borkdude12:10:13

If you're not interested in that, just don't use the linter, it is disabled by default

serioga13:10:07

@borkdude which linter is disabled by default? At the moment “clj-kondo v2022.10.05” warns me about :include-macros and I did not enable it AFAIK

borkdude13:10:35

@serioga Really? Damn, that wasn't my intention

borkdude13:10:19

I must have not been paying attention ;)

serioga13:10:41

So will it be kept as is?

borkdude13:10:40

I think we should disable it by default

borkdude13:10:05

Especially for the first few months

borkdude13:10:09

I do this for all new linters

Noah Bogart13:10:57

Oops, also my bad. Sorry about all this

borkdude13:10:54

No problem, people can always use #_:clj-kondo/ignore I think but I don't want to disturb anyone's CI by upgrading blindly ;)

serioga13:10:26

At least now I know how to switch it off :-)

borkdude13:10:56

LGTM, barring a few minor comments

borkdude20:10:00

@nbtheduke Now that we have the linter on in the current clj-kondo anyway, I've thought about it some more and maybe we should just leave it on, but I want to have an option to add options (for custom languages like clojuredart, or whatever is to come) to add options that should not be warned about, I think

Noah Bogart20:10:29

How do you want it to look?

borkdude20:10:49

Probably :exclude [:import-foobars]

👍 1
borkdude10:10:39

@nbtheduke Perhaps we should also add an option to this so people can exclude certain options in user space

serioga10:10:41

oops, I see a message above 😳

serioga10:10:47

@borkdude will it be accepted in CLJ files too? Or I shoud use reader conditionals in CLJC files? At least Clojure compiler does not complain about this option.

imre16:10:10

linter idea: functions that should probably not be used as the reducing function in a call to transduce based on https://twitter.com/cgrand/status/1578401747835445252

borkdude16:10:19

we already have that for reduce @imre: reduce-without-init

imre16:10:49

that's different

imre16:10:52

(transduce identity - 0 (range 5))
=> 10
it's about using - as the reducing fn

imre16:10:06

vs

(transduce identity (completing -) 0 (range 5))
=> -10

imre16:10:22

(which is what I would expect if I looked at the first snippet)

borkdude16:10:24

yes, it is similar to reduce-without-init, but then as the reducing function

borkdude16:10:51

oh I see, it is different ;)

imre16:10:04

it's about the completing arity, not the starting init one 🙂

borkdude16:10:01

Feel free to provide an issue with example cases

imre16:10:14

will do 🙂

Noah Bogart17:10:01

oof, that's complicated