Fork me on GitHub
#tools-deps
<
2018-12-20
>
geraldodev22:12:36

It would be nice if clj show invalid edn parsing errors

dominicm23:12:10

I think there is a ticket for that, it's been mentioned. I think one would be welcome if you can't find one, if you can, a vote helps prioritize.

Alex Miller (Clojure team)23:12:29

I was planning to look at that for the next release

Alex Miller (Clojure team)23:12:46

but there are limits to what we can do other than say “the edn is invalid”

Alex Miller (Clojure team)23:12:28

since the edn file is a map, it either will read the whole thing, or it will fail (if you miss a brace for example)

dpsutton23:12:39

and bang for the buck i suppose. EOF encountered while ... is the current message, right?

dpsutton23:12:07

it seemed straight forward but maybe that is stockholm syndrome

dominicm23:12:36

@alexmiller is this the same behaviour as for Clojure? Could we look at something like the figwheel error tool?

Alex Miller (Clojure team)23:12:41

I’m planning to catch this case and make the error message better (and skip the stack trace) but it’s probably not going to actually help you in a lot of cases

dominicm23:12:55

Probably good questions for JIRA 😊

Alex Miller (Clojure team)23:12:56

sorry, don’t have context on figwheel

dominicm23:12:39

I think figwheel can print out a snippet and give you an ASCII arrow pointing at the error.

Alex Miller (Clojure team)23:12:43

the errors I see reported are almost always invalid edn (usually a missing brace), not a valid map that is invalid

Alex Miller (Clojure team)23:12:25

I think figwheel is doing that with spec-like validation on invalid values, but that’s not the error I’m describing

Alex Miller (Clojure team)23:12:56

we have specs and (if we bump the min clojure version) can check the read map against the specs to get that, but again, that’s not where I see most issues

geraldodev23:12:55

I was bitten by Map literal must contain an even number of forms. Even on a modest file size it's very pratical to be pointed to the exact spot. I've downloaded diogo149/lein-edn-validator to help me find .

geraldodev23:12:10

@dominicm tons of issues. ppl are using tools.dep. That's good!

dominicm23:12:58

@alexmiller figwheel also does something with the data coming out of cljs compiler, and can information related to this. I suppose in theory tdeps can be even smarter if the data was available from clojure.edn

Alex Miller (Clojure team)23:12:21

Well, I’m not planning to do that