Hi everyone eastwood gives me a weird error when I run it on my project. Can you help me figure out what it is about ?
Could you try to create github repo with a minimal repro?
I can’t say I’ve seen this before…
Here you are @slipset https://github.com/clov0/sample Thanks a lot
Would be great if you could strip it down a bit. Can’t do anything now because the stellar
libs are not available to me.
Oh sorry
np
I removed all stellar libs
and the deps in the source as well?
Yup
Can’t really understand what’s going on, but it seems connected to core.async
A workaround would be something like this:
(ns stellar.single-runner.components.om.test-op
(:require [com.stuartsierra.component :as component]
[clojure.core.async :as async]
[taoensso.timbre :as timbre]
[stellar.single-runner.components.om.protocol :as p]))
(def client-id "cid")
(defn send-orders* [orders]
(let [access {}]
(async/go
(doseq [ord orders]
(-> (:i-req access)
(async/>! ord))))))
(defrecord test-om [om-config access]
;;---------------------------------;;
component/Lifecycle
(start [component]
(timbre/spy :info ["Starting Test OM " om-config])
(let [i-req (async/chan)
o-resp (async/chan)
o-data (async/chan)]
(-> component
(assoc :access
{:i-req i-req :o-resp o-resp :o-data o-data}))))
(stop [component]
(timbre/spy :info ["Stopping Test OM " om-config])
(-> component
(assoc :access nil)))
;;---------------------------------;;
p/Ops
(send-orders [om orders]
(send-orders* orders))
(stop-client! [om]
(timbre/spy "Stop Om Client"))
(<-client-id [om]
(->> client-id))
(<-req-ch [om]
(:i-req access))
(<-data-ch [om]
(:o-data access))
(<-resp-ch [om]
(:o-resp access)))
(defn ->test-om [m]
(map->test-om m))
Sorry, but I didn't quite get what got changed here ?
I extracted the meat of the send-orders
implementation into its own function send-orders*
(which had an error btw 🙂
Thanks a lot @slipset
No worries. Still have no clue why eastwood can’t analyze/lint it though…
Thanks. Will file an issue on their github
I recall having one or two case statements inside of Eastwood where I saw several cases of the tools.analyzer.jvm AST node types, but not all of them, and rather than silently doing nothing when an unknown node type was seen, I threw an exception.
When running on the crucible, or adding new projects, it is a good way to make it obvious when a new case appears that has not been seen by the Eastwood devs before (at the time, only me)
It is not the most polite thing to put in the hands of users, I know, but it does tend to get the new cases reported with actual production code, rather than me making a wild guess how that node type ought to be handled.