Would this info-level warning be annoying or helpful? Please respond in ๐งต
Helpful, because in my experience, anything that says java.lang... can ofter deter people from wanting to touch it
Would it notice that the class has been imported if it's something from the class path rather than the jdk/clojure core?
why's that?
@l0st3d we can make that as well, I think it's a separate but related issue
helpful
helpful, especially since that list may change in 1.13: https://clojure.atlassian.net/browse/CLJ-2383
i like this
I like it. Good point from @rolthiolliere, if these do change in 1.13, linting advice would be different on 1.13 than 1.12. I forget how clj-kondo handles this kind of thing.
but if someone develops a library with 1.13 on the classpath and they make the names unqualified, the lib won't work under 1.12 but clj-kondo will still warn
but I guess that's a similar problem to using new clj core functions
I guess when one targets 1.10 or so, one should dev with 1.10
Cool, makes sense. Side thought: another advantage of libs depending on a min version of Clojure is that min version will also be used, by default, for linting.
I'd like this linter -- I just checked our codebase at work and we have a few java.lang.Thread, java.lang.Exception, and java.lang.AssertionError (in tests!).
To clarify the 1.13/1.12 issue, if I write code today that has to contain java.lang.<Something> because that is not auto-imported, clj-kondo would not warn, correct? (because the code won't work today without java.lang.) And that would remain true even if I switched to 1.13 and that class became auto-imported.
Or would clj-kondo have some mechanism for telling it which version of Clojure I'm targeting?
I just uses the specified classpath, Sean. Whatever version of Clojure is on the classpath is used for linting.
Oh, so it already does version-specific checks? So a library that, say, depends on 1.12 by default but is also tested on 1.9, 1.10, and 1.11 is going to get linted as 1.12 based?
Yep.
See my oh-so-sage side thought above.
And that would remain true even if I switched to 1.13 and that class became auto-imported.It depends if you lint with clojure 1.13 on the classpath
at least that's how it works for using vars from 1.13 and for consistency, also for the above linter then I guess
Very cool. I guess I just never thought about it being version-sensitive like that...