xsc / lein-ancient

Check your Projects for outdated Dependencies
MIT License
561 stars 33 forks source link

re-matches assertion error with profiles section in project.clj #99

Open catinthetap opened 6 years ago

catinthetap commented 6 years ago

I get the following error:

:cause "Assert failed: (re-matches #\"(\s|,)+\" s)" :via [{:type java.lang.AssertionError :message "Assert failed: (re-matches #\"(\s|,)+\" s)" :at [ancient.rewrite_clj.v0v4v13.rewrite_clj.node.whitespace$whitespace_node invokeStatic "whitespace.clj" 56]}] :trace [[ancient.rewrite_clj.v0v4v13.rewrite_clj.node.whitespace$whitespace_node invokeStatic "whitespace.clj" 56] [ancient.rewrite_clj.v0v4v13.rewrite_clj.node.whitespace$whitespace_node invoke "whitespace.clj" 56]

when I runlein ancient against a project.clj with the following profiles section:

  :profiles {:dev     {:dependencies [[midje "1.9.1"]
                                      [ring-mock "0.1.5"]
                                      [http-kit "2.2.0"]]
                       :jvm-opts     ["-Dlogback.configurationFile=config/ReportingService-logback.xml"]
                       :eastwood     {:exclude-linters [:suspicious-expression]
                                      :config-files    ["eastwood_exclusions.clj"]}}
             :repl    {:jvm-opts ["-Dlogback.configurationFile=config/ReportingService-logback-test.xml"]}
             :midje   {:jvm-opts ["-Dlogback.configurationFile=config/ReportingService-logback-test.xml"]}}

Running leiningen 2.7.1 on linux. When I remove :profiles from the map it works fine. My profiles.clj file has this entry for the ancient plugin: [lein-ancient "0.6.14" :exclusions [org.clojure/tools.reader clj-time cheshire joda-time com.fasterxml.jackson.core/jackson-core com.fasterxml.jackson.dataformat/jackson-dataformat-smile]]

thanks UPDATE (2018-05-14) Following investigation by one of my colleagues it looks like the problem is non-printing, non-ASCII characters in the project.clj. Using: cat -A project.clj shows the following:

:eastwood     {:exclude-linters [:suspicious-expression]$
   :config-filesM-bM-^@M-^BM-bM-^@M-^BM-bM-^@M-^BM-bM-^@M-^B["eastwood_exclusions.clj"]}}$
             :repl    {:jvm-opts ["-Dlogback.configurationFile=config/ReportingService-logback-test.xml"]}$
             :midjeM-bM-^@M-^BM-bM-^@M-^B {:jvm-opts ["-Dlogback.configurationFile=config/ReportingService-logback-test.xml"]}$
             :uberjar {:aot :all}})

So, we can write a scan for these and then remove them (our bad) but a warning would be nice too ;-)