-
-
Notifications
You must be signed in to change notification settings - Fork 69
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
py. syntax is doing weird things with the clj-kondo linter #268
Comments
Could you provide a specific example? :) |
It's because clj-kondo has re-written the parser as opposed to using Clojure's compiler itself so its order of evaluation is different than clojure's in terms of macros vs normal forms - https://github.com/clojure/clojure/blob/master/src/jvm/clojure/lang/Compiler.java#L7509. The work around is to not use the py. syntax I think and just write out the expression in terms of (-> get-attr get-attr call-attr ) etc. We have a previous issue about this if you want to look at it. The gist is |
Yep, it's unfortunate. Looks like some of the offending lines may be here here where they have hard-coded lack of support. As @cnuernber mentioned, regarding: https://clojure.org/reference/reader#_reader_forms
This is not at odds with the I would suggest filing an issue with clj-kondo, @sstraust. At first there might be some pushback, but if enough people request it, they may change eventually :) At this point, thousands if not 10's of thousands of people use libpython-clj -- @sstraust I'm sure you're not the only person with this issue. |
The linter is doing something weird, because it assumes that py/py. is actually a reference to the symbol "py/py" with no ".".
I'm unable to write a custom :lint-as for this, because clj-kondo doesn't consider the possibility that "py." could represent a macro. ingoring :unresolved-var doesn't quite fill my usecase, as I want to remove the red squiglies under the second argument of the py. call as well.
I think clj-kondo is technically in the right here, because py. isn't supported clojure syntax, although I do like the py. notation, and it'd be nice if it was supported. I don't ask to change the notation, but it'd be nice to have a workaround that fixes these tooling issues.
https://clojure.org/reference/reader#_reader_forms
Great Library! -- Sammy
The text was updated successfully, but these errors were encountered: