Fork me on GitHub
#clojure-europe
<
2022-12-01
>
dharrigan07:12:28

Good Morning!

grav08:12:26

Morning!

lread10:12:03

Hey, look. Howard's being eaten.

genRaiy10:12:19

Good morning

1
borkdude12:12:46

anyone wanna do some Advent of Code puzzles in babashka, nbb or clerk? https://github.com/borkdude/advent-of-babashka-template https://github.com/nextjournal/advent-of-clerk

šŸ‘€ 1
dharrigan15:12:37

Anybody use gitlab (runner) and caching of dependencies for clojure projects?

Ben Sless15:12:43

With deps, yes

dharrigan15:12:46

ah! you solved the same problem I'm solving

dharrigan15:12:05

why oh why can't the m2 local repo be configured as an external environment variable

dharrigan15:12:30

and thus, we have to resort to messing with the deps.edn during buildtime

Ben Sless15:12:58

You can pass the local m2 with -S flag

mccraigmccraig15:12:27

what do y'all do when your test namespace gets unwieldy ? i've got a case here where an API+impl namespace is 500loc, but the corresponding test namespace is over 1kloc and growing ... my thoughts are to do one of: 1. ignore 2. split the test namespace alone (which will confuse some tooling) 3. move the impls out of the API namespace, then split the impls namespace and the test namespace in step leaning towards option 3 atm...

1ļøāƒ£ 3
3ļøāƒ£ 2
Ben Sless16:12:48

Why do you have lots of code in your tests? Data literals or something else?

mccraigmccraig16:12:56

a lot of different cases ... there are about a dozen functions in the api ns, and each of those requires testing with a few different broad classes of input, and sometimes multiple cases within each class of input ... there is perhaps some scope for abstracting the test code some more, but i have 100 occurences of testing so just quite a lot of individual cases

Ben Sless16:12:00

Any chance it could be covered by generative tests?

mccraigmccraig16:12:20

well a few days ago i was all enthusiastic to use test.check, but sadly this codebase is both clj+cljs and async, and i couldn't see any way of making test.check work with it

Ben Sless16:12:23

Uhh, very carefully?

šŸ˜‚ 2
mccraigmccraig16:12:50

i'm already using a set of modified deftest and testing macros to give me uniform async tests on both clj and cljs ... and afaics test.check would need a rewrite to work with async, so i gave up on it

robert-stuttaford17:12:50

what's the actual manifestation of 'unwieldy'?

Ben Sless17:12:06

Isn't this what #C7Q9GSHFV's rcf is for?

mccraigmccraig17:12:04

@U0509NKGK i find files of >500loc increasingly hard to navigate, extremely hard when &gt;1000loc... on files &lt;500loc i can navigate very quickly by the "visual shape" of the code, but the bigger the file gets the less i seem able to do that... so i prefer files to be <~500loc

mccraigmccraig17:12:03

ah, ok - yeah, rcf seems to have the aim of unifying clj + cljs tests ... i don't think that would be any more compatible with test.check though

Ben Sless17:12:16

It also supports async

mccraigmccraig17:12:06

yep... i have no problem with that though - i have macros which support async tests on clj+cljs, and the tests look and behave almost exactly the same as vanilla clojure.test/deftest tests

vemv23:12:48

I've enjoyed 3 for a few years. Strict API/impl separation in sources and tests with a simple 1:1 mapping. No privacy, keeping the deftests hack-free. I'd go as far as linting that no single ns can exceed ~300LOC - at that point, more often than not things start getting complect-y. (also, code reloading gets faster if you're into reloading one ns at time. Be it with require :reload or tools.namespace)

šŸ‘ 1
robert-stuttaford06:12:50

i find that having a truly reliable lsp go-to-definition is making the line count less of a problem for me. we maintain a 10 year old 150kloc clj[sc] codebase, we've long since left being able to remember where stuff behind, and now lean into knowing how to look for it efficiently

robert-stuttaford06:12:38

however when doing substantial work on a piece of code, that's where pulling things apart into separate nses tends to happen šŸ˜…

Ben Sless07:12:42

Imagine multiple mini windows where the definitions spread out of the form under view like a tree

mccraigmccraig09:12:32

@U0509NKGK i have a similar size codebase, not quite so old ... and have plenty of opportunities to let sleeping dogs lie šŸ˜¬ ... but in this case i'm taking one of the foundational libraries and refactoring/rewriting it with the learning of all those years, so everything is up for grabs

mccraigmccraig09:12:10

@U45T93RA6 what's your favoured technique for referring to impls from APIs ? i've been using simple defs recently, since clj+cljs is more important to me than the nice metadata transparency you get with things like potemkin/import-vars

mccraigmccraig09:12:39

@U0509NKGK totally agree that ability to navigate across a complete codebase is very important as the codebase gets larger ... i abandoned spacemacs because it's nav was too laggy (doom + CIDER is working well for me now)

lemontea15:12:39

morning, recuperating on this few days so Iā€™m out of the loop