borkdude / tools

Tools
19 stars 2 forks source link

lein2deps: "Regex not allowed. Use the ':regex' option" #7

Closed NoahTheDuke closed 1 year ago

NoahTheDuke commented 1 year ago

I'm not sure what happened or if I somehow caused this, but I can't seem to run lein2deps anymore:

$ lein2deps
----- Error --------------------------------------------------------------------
Type:     clojure.lang.ExceptionInfo
Message:  Regex not allowed. Use the `:regex` option
Data:     {:type :edamame/error, nil 8}
Location: /home/noah/.gitlibs/libs/io.github.borkdude/lein2deps/e26edeb114c9d88a5c4d3abb683306588fcaad13/src/lein2deps/internal.clj:21:63

----- Context ------------------------------------------------------------------
17:         cfg {:read-eval identity}
18:         form (first (take-while #(or
19:                                   (and (seq? %)
20:                                        (= 'defproject (first %)))
21:                                   (= ::e/eof %)) (repeatedly #(e/parse-next parser cfg))))
                                                                  ^--- Regex not allowed. Use the `:regex` option
22:         project-clj-edn form]
23:     (apply hash-map (drop 3 project-clj-edn))))
24:
25: (defn qualify-dep-name [d]
26:   (if (simple-symbol? d)

----- Stack trace --------------------------------------------------------------
edamame.impl.parser/throw-reader       - <built-in>
edamame.impl.parser/parse-sharp        - <built-in>
edamame.impl.parser/dispatch           - <built-in>
edamame.impl.parser/parse-next         - <built-in>
edamame.impl.parser/parse-to-delimiter - <built-in>
... (run with --debug to see elided elements)
lein2deps.api/lein2deps                - /home/noah/.gitlibs/libs/io.github.borkdude/lein2deps/e26edeb114c9d88a5c4d3abb683306588fcaad13/src/lein2deps/api.clj:28:23
lein2deps.api/lein2deps                - /home/noah/.gitlibs/libs/io.github.borkdude/lein2deps/e26edeb114c9d88a5c4d3abb683306588fcaad13/src/lein2deps/api.clj:11:1
lein2deps.api                          - /home/noah/.gitlibs/libs/io.github.borkdude/lein2deps/e26edeb114c9d88a5c4d3abb683306588fcaad13/src/lein2deps/api.clj:63:11
clojure.core/apply                     - <built-in>
user                                   - /home/noah/.babashka/bbin/bin/lein2deps:15:1
borkdude commented 1 year ago

Can you try with --eval?

NoahTheDuke commented 1 year ago

That worked. Thanks.

borkdude commented 1 year ago

Let's leave this issue open. I think regexes are pretty harmless which should be supported out of the box. Development of lein2deps is done here: https://github.com/borkdude/lein2deps. This can be fixed by adding :regex true to the parse options.

NoahTheDuke commented 1 year ago

Thank you for the quick fix!