-
-
Notifications
You must be signed in to change notification settings - Fork 290
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
Typed Clojure Support #2210
Comments
Can you post some examples of what is causing false positives with clj-kondo for typed clojure? Please be as specific as possible, so let's focus on something concrete and small first. |
I'm paraphrasing this code so the line numbers won't quite line up:
I have a hook that rewrites t/defn to a node that looks a little like this (see the linked PR in typed-clojure for the specific code, if it matters):
because of this, the code in t/defn lints without errors even though there is a weird
|
I think this error happens because |
Also it is recommended to emit a fully qualified node symbol since
=>
|
Ah I see. I tired
and it worked much better. Thanks. While I have your attention then, I'll pester you with a related question & observation.
I've been getting confused, consistently, about when I'm supposed to reach in to a node and extract something and whether the extracted thing is a node or not. I'd offer to write something for the docs, but I still don't know. |
re 1: because at the time that got added, hooks didn't exist yet and it was a very common source of false positives |
Btw if the syntax of the typed clojure defn is exactly the same as the schema one, you could probably also use |
Is your feature request related to a problem? Please describe.
There is a well-known project to add a type checker to Clojure. I would like to use types, a linter and Clojure simultaneously and I have been experimenting with the idea in the PR, but it is a struggle.
I'm trying to use a hook to get my project to pass a lint. There is a lot to do, but picking on a specific problem I have a
defn
-like form that is syntactically quite different fromdefn
, but semantically very similar. Thehook
mechanism lets me rewrite code for linting, but the analyzer doesn't seem to use the resulting code so I get unresolved symbol errors even though thedefn
form itself passes.Describe the solution you'd like
What would the expected path be to go about adding clj-kondo support to a project like typedclojure? I am aware of support for schema that require code in the analyzer itself. I'm hoping that there is some sort of
reg-var!
function call in the hooks API so I don't have to write analyzer code. I don't understand how the analyzer works and it looks intimidating.I'd also be worried about the long-term prospects of that approach since it would require coordination between clj-kondo and typedclojure that seems like an unnecessary maintenance challenge compared to a mechanism like using hooks.
Describe alternatives you've considered
#_:clj-kondo/ignore
tempts me every day.Additional context
N / A
The text was updated successfully, but these errors were encountered: