I'm often interested in removing unused code. I really the :warn-on-reflection linter with clj-kondo. I'd also like to know when I've got (set! *warn-on-reflection* true) set unnecessarily. I don't see a linter for this currently. Is this something that's interesting to others as well?
clj-kondo only warns about adding warn-on-reflection when you use Java interop. it can't actually see if reflection is happening or not, so it's purely looking at the presence of interop, not reflection. so it can't accurately tell you if reflection is going on, unless you don't use any interop
Sorry if I wasn't clear. I understand clj-kondo can't determine whether reflection is actually occurring, but it can detect whether or not there is Java interop. What I'm thinking is that if there is no Java interop, but (set! *warn-on-reflection* true) is present, it would warn that the set! is unnecessary. Does that make sense?
I guess it does make sense, but personally I don't mind the set! being there in case I do add interop again in the future, which is very likely in any project
I can understand that. On the other hand, I prefer to only have code that is necessary. clj-kondo will advise me if I add some Java interop and once again require the set! 🙂
issue (+ optional PR) welcome
(Sleep is currently more welcome 🙂 I'll talk to you later 💤 )