clj-holmes / clj-watson

clojure deps SCA
Eclipse Public License 2.0
83 stars 9 forks source link

Explicitly close dependency-check engine when done #89

Closed lread closed 3 months ago

lread commented 3 months ago

Restructured internal code slightly to match semantics of working with a resource that is open then closed.

Closes #86

seancorfield commented 3 months ago

How do you feel about a slight refactor of that, like so:

Have scan-jars return engine (as before) and then:

  (with-open [engine (build-engine dependency-check-properties clj-watson-properties)]
    (-> engine
        (update-download-database)
        (scan-jars dependencies)
        (.getDependencies)
        (Arrays/asList)))

Since the last two calls only have a single argument, there's no need for ->> here.