Skip to content
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

Handle maps with odd pairs for schema.core/defn #2048

Closed
ericdallo opened this issue Apr 13, 2023 · 1 comment
Closed

Handle maps with odd pairs for schema.core/defn #2048

ericdallo opened this issue Apr 13, 2023 · 1 comment
Projects

Comments

@ericdallo
Copy link
Member

version

2023.03.17

macro usage

Maybe? schema.core/defn is handled by clj-jondo built-in so could be related.

platform

JVM

editor

reproducible with lsp as well

problem

for schema.core/defn when you have a map with odd pairs all analysis of that function are lost:

This works, returning all keywods, var-usages and other analysis as expected, even with invalid map (common when you are writing code and completing):

(defn foo []
  (str {:a 1 :b}))

This doesn't return any analysis inside foo:

(schema.core/defn foo []
  (str {:a 1 :b}))

more context

repro

clj -Sdeps '{:deps {clj-kondo {:mvn/version "2023.03.17"}}}' -m clj-kondo.main --config '{:config-paths ^:replace [] :output {:format :json :analysis {:keywords true}}}' --lint - <<< '(ns foo (:require [schema.core :as s])) (s/defn foo [] (str {:a 1 :b}))' |jq .

expected behavior

Expect to return the same analysis if the function would be a clojure.core/defn

I can find some time to help if guide me to where fix that

@borkdude borkdude added this to Needs triage in clj-kondo via automation Apr 13, 2023
@borkdude borkdude moved this from Needs triage to High priority (next release) in clj-kondo Apr 13, 2023
clj-kondo automation moved this from High priority (next release) to Done Apr 13, 2023
@ericdallo
Copy link
Member Author

Thank you very much! works like a charm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
clj-kondo
  
Done
Development

No branches or pull requests

1 participant