Fork me on GitHub
#eastwood
<
2022-06-13
>
Ho0man16:06:09

Hi everyone, Eastwood keeps getting me warnings for these spec lines :

(spec/map-of
    (spec/spec string?
               :gen (fn [] (gen/fmap
                             #(apply str %)
                             (gen/vector
                               gen/char-alpha
                               5 20))))
    (spec/coll-of
      (spec/tuple ::i-commons/source ::sub-type)
      :into #{}
      :min-count 2
      :gen-max 7)
    :min-count 2
    :gen-max   8)
the error is :
== Linting hermes.van-buren.core.event.rlc.model ==
src/hermes/van_buren/core/event/rlc/model.clj:201:3: constant-test: Test expression is always logical true or always logical false: 2 in form (if or__5533__auto__ or__5533__auto__ (clojure.core/or 0)).
src/hermes/van_buren/core/event/rlc/model.clj:201:3: constant-test: Test expression is always logical true or always logical false: nil in form (if nil (clojure.core/inc nil) 2).
src/hermes/van_buren/core/event/rlc/model.clj:201:3: constant-test: Test expression is always logical true or always logical false: nil in form (if or__5533__auto__ or__5533__auto__ (clojure.core/or java.lang.Integer/MAX_VALUE)).
removing the :min-count option from the spec/map-of and the likes fixes the issue. Is this a bug or am I doing something wrong? Thanks a lot

vemv05:06:23

Hi, could you please open the same as an issue? It's much easier for me to keep track of things that way.

Ho0man06:06:14

Sure, will do