This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-09-24
Channels
- # announcements (30)
- # asami (9)
- # babashka (37)
- # beginners (120)
- # calva (26)
- # cider (3)
- # clara (9)
- # clj-commons (7)
- # clj-kondo (17)
- # cljsrn (2)
- # clojure (32)
- # clojure-europe (56)
- # clojure-nl (1)
- # clojure-norway (13)
- # clojure-uk (4)
- # clojurescript (34)
- # conjure (1)
- # copenhagen-clojurians (8)
- # core-async (21)
- # cursive (2)
- # datahike (2)
- # datascript (5)
- # events (4)
- # fulcro (32)
- # graalvm (10)
- # heroku (3)
- # introduce-yourself (1)
- # jobs (2)
- # lsp (3)
- # luminus (1)
- # malli (8)
- # meander (15)
- # minecraft (1)
- # nrepl (2)
- # off-topic (57)
- # pathom (2)
- # polylith (35)
- # reagent (6)
- # reitit (8)
- # releases (1)
- # rewrite-clj (7)
- # shadow-cljs (21)
- # timbre (4)
- # tools-build (1)
- # tools-deps (33)
- # vrac (8)
Is there already a tool to detect the licenses from project dependencies for Clojure CLI tools (deps.edn) projects? https://github.com/technomancy/lein-licenses is a Leiningen plugin that I could hack into a separate project, if nothing exists already
I know that Snyk (which is a paid service) does kinda support this in Clojure. You can use their service to connect to Github repos (which will give you some basic code and Docker insights even with Clojure), and then if you use a Github action (other solutions exist) to create a temporary Maven POM from the project, you can "send" that POM to Snyk and it will figure out your License exposure / situation for you. It's not an ideal solution but we use it 'cos we use Snyk anyway for the Python and JS repos on the stack. Just a thought.
Yes, that is the other option I had in mind. Will need to check with work if they are happy for me to run the Synk service over the company GitHub organisation 🙂
Ideally it would be nice to have a license tool working with the new tools.build (but I haven't started looking at that yet)
Oh, a http://Synx.io enterprise license is required to get a report on the licenses used in dependencies. So I guess I will be hacking the lein-licences plugin code...
I've done a little hacking around on this, nothing worth using yet
Happy to collaborate or at least be able to test on our projects at work
nothing worth sharing, and am happy to toss what I've done in the trash
the signal you should take is - I think it's a useful thing to exist :)
One downside to using via maven is that it doesn't quite match what classpath you get with tools.deps.
is this valid clojure some how? (require '[schema.core :as s] bidi.schema)
(require '[schema.core :as s]
'bidi.schema)
;; or
(require '[schema.core :as s]
'[bidi.schema])
They're not "unlisted args" but :require
and require
are variadic.my repl is saying no.
failed to parse ns. reason "extra input"
it was't presented in a ns form. It just called rquire directly.
gotcha, i see the unlisted args to require so infrequently. i suppose it takes either and the list types can be used to pass more information :refer :as etc...
@drewverlee I found this blog post helpful here, maybe have a look: https://stuartsierra.com/2016/clojure-how-to-ns.html
Require has to take symbols and imbue them with meaning thereafter. If they aren’t quoted they are attempted to be resolved as arguments and that would necessarily fail in the general case
require
is a function, args are evaluated before it's invoked, quoting is required to not evaluate them.
:require
is a clause in the ns
macro where evaluation of args is not done, so quoting is not required
confusingly, import
is a macro and it works with either quoted or unquoted inputs (but I always quote, to make it work/look the same as require
so that I don't have to remember the difference)
Anyone have experience with swing/seesaw?
How can I watch a JTextField
or (seesaw.core/text)
widget for text changes?
(defn main-panel
[]
(s/border-panel
:center (s/canvas :id :canvas :background (c/color "white") :paint paint-canvas)
:south (s/horizontal-panel
:items [(s/action :name "Create Wallpaper"
:handler (try (make-wallpaper @wallpaper-width @wallpaper-height)
(catch Exception e (.printStackTrace e))))
(s/label "Width:")
(s/text :listen [:document #(reset! wallpaper-width %&)])
(s/label "Height:")
(s/text)
(s/action :name "Apply"
:handler #(fn [_]
(reset! wallpaper-width 150)
(reset! wallpaper-height 150)))])))
Not really sure how to do it, at least this one doesn’t crash when I edit the text field, but it’s still not quite right.I got it working; Save this example for future reference:
(defn number-input-text
[atom]
(let [textfield (s/text :text @atom)]
(b/bind
textfield
(b/transform #(try (reset! atom (Long/parseLong %))
(catch NumberFormatException e
(println "Not a number" %))
(catch Exception e
(println "Error:" e))))
(b/bind
(b/transform #(if (int? %)
"white" "lightcoral"))
(b/property textfield :background)))
textfield))
(defn main-panel
[]
(s/border-panel
:center (s/canvas :id :canvas :background (c/color "white") :paint paint-canvas)
:south (s/horizontal-panel
:items [(s/action :name "Create Wallpaper"
:handler (fn [_] (try (make-wallpaper @wallpaper-width @wallpaper-height)
(catch Exception e (.printStackTrace e)))))
(s/label "Width:")
(number-input-text wallpaper-width)
(s/label "Height:")
(number-input-text wallpaper-height)])))
I got it working; Save this example for future reference:
(defn number-input-text
[atom]
(let [textfield (s/text :text @atom)]
(b/bind
textfield
(b/transform #(try (reset! atom (Long/parseLong %))
(catch NumberFormatException e
(println "Not a number" %))
(catch Exception e
(println "Error:" e))))
(b/bind
(b/transform #(if (int? %)
"white" "lightcoral"))
(b/property textfield :background)))
textfield))
(defn main-panel
[]
(s/border-panel
:center (s/canvas :id :canvas :background (c/color "white") :paint paint-canvas)
:south (s/horizontal-panel
:items [(s/action :name "Create Wallpaper"
:handler (fn [_] (try (make-wallpaper @wallpaper-width @wallpaper-height)
(catch Exception e (.printStackTrace e)))))
(s/label "Width:")
(number-input-text wallpaper-width)
(s/label "Height:")
(number-input-text wallpaper-height)])))