Fork me on GitHub
#babashka
<
2023-02-08
>
Matthew Downey17:02:17

I've been playing around with rewrite-clj more, since it's built in, and I wrote a babashka script to count lines of code and also show lines of docstrings / comment forms. If anyone wants to try it out, the following one-liner should work, but https://github.com/matthewdowney/linesofcode-bb has more elegant ways as well:

bb -Sdeps '{:deps {io.github.matthewdowney/linesofcode-bb {:git/tag "v0.0.1" :git/sha "4dbee31"}}}' \
   -x com.mjdowney.loc/breakdown --root "src/"

babashka 8
rewrite-clj 6
borkdude18:02:44

Nice!

|                                              File |   LOC | Docs | Comment Forms | Lines |
|---------------------------------------------------+-------+------+---------------+-------|
|                   src/clj_kondo/impl/analyzer.clj |  2726 |   15 |             2 |  2966 |
|               src/clj_kondo/impl/var_info_gen.clj |  2400 |    1 |             0 |  2408 |
...

Sam Ritchie22:02:19

huh, a friend is working through my deps-new template that uses babashka, and noted this…

borkdude22:02:50

perhaps because of git usage?

Sam Ritchie22:02:43

looks like his “developer machine” was missing some crucial tooling

Sam Ritchie22:02:01

okay, can’t complain about that, any CLI tool would do that

Sam Ritchie22:02:06

sorry for the noise!

seancorfield22:02:14

Perhaps brew is the culprit there?

seancorfield22:02:00

The brew team are very opinionated that everything should always be updated to the very latest version so a "simple" brew install of one tool can end up downloading updates to the entire world 😞

Sam Ritchie22:02:11

talk about annoying, I’ve noticed that too!

borkdude22:02:35

This helps a bit:

$ echo $HOMEBREW_NO_AUTO_UPDATE
1

2
🎉 2
pithyless22:02:18

I don't think that's enough to solve unexpected "brew hangs". My env includes:

HOMEBREW_NO_ANALYTICS=1
HOMEBREW_NO_AUTO_UPDATE=1
HOMEBREW_NO_INSTALL_UPGRADE=1
HOMEBREW_NO_INSTALL_CLEANUP=1
HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK=1

pithyless22:02:07

I think the default homebrew setup should just show Monty Python's "Spanish Inquisition" meme whenever you try to run something.

💯 4
2
Sam Ritchie22:02:35

@U05476190 wow, brew is fast (kind of) again with this

borkdude13:02:10

I'm giving this another chance without the HOMEBREW_NO_* stuff