tolitius / boot-check

check, analyze and inspect Clojure/Script code
Eclipse Public License 1.0
70 stars 9 forks source link

throw-on-errors of with-eastwood does not work #15

Open sniperliu opened 6 years ago

sniperliu commented 6 years ago

throw-on-errors of with-eastwood does not work, it make CI pass even with eastwood warnings.

Did a brief investigation, eastwood/check did not return errors.

The usage of boot.pod/with-eval-in seems the cause of problem.

tolitius commented 6 years ago

if you'd like to throw on eastwood errors you should add --throw-on-errors option, or just -t.

check out the docs

$ boot check/with-eastwood -t
...
== Warnings: 11 (not including reflection warnings)  Exceptions thrown: 0
WARN: eastwood found some problems ^^^

...
                    tolitius.boot-check/with-throw           boot_check.clj:   27
                              clojure.core/ex-info                 core.clj: 4617
clojure.lang.ExceptionInfo: eastwood checks fail
    causes: {:err nil, :warning-count 11, :exception-count 0}
clojure.lang.ExceptionInfo: eastwood checks fail
    line: 66
sniperliu commented 6 years ago

Thanks for your reply.

I had added the flag.

(deftask build []
  (comp (check/with-eastwood "-t")))

Below is the CI logs.

 ^{:line 149}
 (^{:line 149} change-pet-name
  ^{:line 149}
  [^{:line 149} _ ^{:line 149} _ ^{:line 149} _ ^{:line 149} _])
 ^{:line 151} p/TeamAdmin
 ...)

An exception was thrown while analyzing namespace rmi-service.set.datacenter 
Lint results may be incomplete.  If there are compilation errors in
your code, try fixing those.  If not, check above for info on the
exception.
Job succeeded

Boot Version: 2.7.1 boot-check: 0.1.6

tolitius commented 6 years ago

your CI is saying that An exception was thrown, but it (your CI) succeeds the job. This would mean the exception is caught and ignored outside of boot-check.

try to run it from command line, you should see the exception.

robertluo commented 6 years ago

Eastwood raised an exception because the project can not be compiled, while boot-check just checked warnings not exceptions, so the exit code of the task is 0 indicating no error. The workaround is simple for this project: adding "aot -a" before linting.