Fork me on GitHub
#clojure
<
2020-08-14
>
seancorfield00:08:21

@smith.adriane Just checking: you did switch your credentials from username/password over to the new username/token?

phronmophobic00:08:50

I did. I just got a response in #clojars that I posted a few hours ago. The problem was the size of my jar. I guess I was too impatient when I reposted in #clojure!

Andrea Imparato09:08:07

imo clojure is a marxist language because it liberates you from all the superstructures of all the other programming languages lol

mloughlin09:08:55

defmacro owns the means of (code) production

3
reefersleep10:08:00

When there are failing tests in our CICD, it would be pretty cool if the test output could report the last people to touch the test ns in git. I was wondering if someone knew about existing functionality like this? Maybe a Clojure test lib, or some blog post discussing an implementation of what I’m thinking of?

reefersleep10:08:40

Perhaps one could use with-tap-output, then handle errors programmatically and have Clojure ask git who the failing ns file “owner” is, printing that along with the regular test output. It doesn’t seem straightforward 🙂

reefersleep10:08:53

Oh, I conflated tap and TAP. Oops.

reefersleep10:08:02

Does anyone know a good way to get Clojure test output as data?

reefersleep10:08:28

Is it a matter of redirecting stdout output somewhere else during the tests, intercept the text and do regex inspection to find the interesting bits, inject strings where appropriate and forward to stdout?

delaguardo11:08:05

almost all clojure test runners can output results as data. which one you are using?

reefersleep11:08:24

Thanks for the rubber ducking + statement of general fact 🙂 I didn’t know that, and knowing it gives me confidence that it makes sense to invest time pursuing the issue!

reefersleep11:08:39

I think we might be using more than one. One subproject uses https://github.com/lambdaisland/kaocha , for example

reefersleep11:08:53

Looking into this, it seems to me that for Kaocha I might need to inject a test report that does what I want. https://github.com/lambdaisland/kaocha/blob/master/src/kaocha/report.clj

Adam Helins15:08:00

What conventions do you use when renaming namespaces? I typically only rename in a consistent way rather than shortening on an arbitrary name I like. For instance, it would be common to rename library.something.algo to algo, which I find confusing in the longer term. Instead, I would reduce the first "node" to a capital letter, it if is used frequently and well-known. If it still remains clear, I can allow myself to do the same with any subsequent "node" and append all those capital letters. For instance, library.something.algo would preferably become L.something.algo, and possibly LS.algo. In my own application, I tend to replace "root" nodes with $. So, if my main namespace is , then I can rename my-company.app.algo to $.algo.

isak15:08:18

Seems good to me. For the last thing about shortening for your own app, I'd choose a different symbol, since that will create confusion/problems with ClojureScript (`$` may create an expectation that you are using jQuery or something). What I do is to only have abbreviations (somewhat arbitrary ones) for 3-5 namespaces in my own app that are commonly used, and for the rest I just use the long version (no :as alias).

lilactown16:08:41

what I attempt to do is treat aliases as canonical - so if I alias a namespace to algo, I will use that same alias everywhere

👍 9
lilactown16:08:13

this way I build up a short hand language in my head of what I’m talking about, so I know algo is always library.something.algo

lilactown16:08:22

I tend to use pretty short aliases - e.g. h or s - but I also prefer to never refer so I feel like I get something back by using short aliases 😛

Adam Helins16:08:26

What I dislike about dropping "nodes" is that it is easy to loose track of where that namespace come from, especially if we end up with such a generic name as algo. That why I keep those capital letters. I do that only if it's really, really obvious. For instance: lambdaisland.glogi.console -> glogi.console ("glogi" is already very specific and recognizable) com.fulcrologic.fulcro.application -> F.app ("F" reminds me of Fulcro and it is used very often, "com.fulcrologic" is truly unnecessary, and "application" can be somewhat exceptionally shortened to "app" because it is so guessable)

Adam Helins16:08:25

@U4YGF4NGM But yes, being canonical about it is of the uttermost importance!

lilactown16:08:17

that makes sense. what I’ll do with long & generic namespaces is abbreviate it by the last two or three words - e.g. com.fulcrologic.fulcro.application becomes fa

👍 3
Alex Miller (Clojure team)18:08:36

consistency in a project is more important than the scheme

👍 12
vemv18:08:34

Mandatory link :) https://stuartsierra.com/2015/05/10/clojure-namespace-aliases the other week I implemented a rewrite-clj thing that makes a given project conform with it. Works really nicely, will share in a few months when rewrite-cljc is released

strsnd18:08:55

Hm, is there a more idiomatic way to write (mapv #(%1 %2) [funcs...] [vals...]) ? Just wondering.

strsnd18:08:20

@alexmiller thanks, it was just a hunch I might be missing some abstraction