home.social

#justfile — Public Fediverse posts

Live and recent posts from across the Fediverse tagged #justfile, aggregated by home.social.

fetched live
  1. I want to code, so I should use:

    - nix
    - /#devenv/#flox
    -
    -
    - {{ insert_other_arcane }}

    And then or for the command runner.

    This is all in a move to progress yes. But it can be a lot for people wanting to work. 🫠

  2. Has anyone ever used `just` instead of `make` as a task runner for a project? If so, how did it work for you? Any feedback?

    just.systems/man/en/

    I have some nontrivial cargo command invocations that need to support parameterization, so I'm considering adding a task runner to the project. Just wondering, should I stick with `make`, or try something new? 🤔

  3. I been looking at and this is complex. 🤔 The command runner has so many abilities. And verbose too. 🫠

    I don't think I'll use for myself, but I can see utility for shared tasks.

    For me is enough. Not too complex. Has a syntax. And NOT . 😅

    taskfile.dev/usage/

  4. The @tailscale folks have some excellent YT videos on setting up self-hosted servers on Digital Ocean using Terraform, Ansible, and of course, Tailscale. I just got my first Droplet running.

    Part 1 - Getting started with cloud-init: youtu.be/e-X5FJwrkaA?si=t3iLP-
    Part 2 - Terraform: youtu.be/PEoMmZOj6Cg?si=2IwHCw
    Part 3 - Ansible: youtu.be/k5Xgt31yK2U?si=28MPbw

    #selfhosting #Tailscale #privacy #indiweb #terraform #ansible #justfile

  5. Ok, this seems _pretty ok_. Each project's `justfile` will have a little boilerplate of 2 imports and a `fetch` recipe.

    My default justfile can be grabbed with `just fetch` if users want it. The second import is mostly for me and my local filesystem setup.

    That should solve for my local dev, make it relatively easy for other devs to get my default `justfile`, _and_ not repeat the same recipes in every project.

    I think. We’ll see! 😅

    github.com/adamghill/dotfiles/

    #Python #justfile

  6. Sharing so it's easier for me to remember: #justfile recipes can take splat arguments.

    test *args:
    pytest tests {{ args }}

    Means I can do

    just test -xk Links

    and that'll expand to

    pytest tests -xk Links
  7. Unreasonably pleased by a tiny tweak to scripts. I keep most of them in a . I have these useful help/h recipes:

    # list recipes, optionally filtered by REGEX.
    @help *REGEX:
    if [[ '{{ REGEX }}' == '' ]]; then just -lu; else just -lu --color=always | rg --pcre2 -i '{{ REGEX }}'; true; fi

    alias h := help

    and shell alias j=just; so to list foo-related scripts I’m often typing

    j h foo

    It's short, but… I added alias h='just help’, now it’s much better:

    h foo

    🎉

  8. And the next part: importing transactions you may have forgotten but your forecast rules have not. Nicely avoids importing transactions twice.

    YEAR := `date +%Y`
    FORECASTJ := YEAR / YEAR + '-forecast.journal'

    # import any recent transactions generated by forecast rules; --dry to preview
    @import-forecast *ARGS:
    hledger import -s -I --auto --forecast=-15days..tomorrow {{ FORECASTJ }} "$@"

    (import explained: hledger.org/dev/hledger.html#i)

  9. (In future, if osh/ysh get some make/just-inspired features or libraries (seems quite possible), the pendulum may swing back to using shell only.

  10. I'm using `just` eg to manage developer/maintainer task scripts for , and to manage personal finance/time/task scripts.

    Here's one for showing a near-term transactions forecast:

    # show forecast transactions predicted recently and soon
    @forecast *ARGS:
    hledger print -I --auto --forecast=-15days..+15days tag:generated "$@"

    (Forecasting explained: hledger.org/dev/hledger.html#f)

  11. You can achieve some of these things with make, if you work hard enough, and ensure you have the right version, but it's more complicated, more fragile, less portable, and harder for others to understand.

  12. Why I’m using `just` for script management after many years with make/shell:

    - you can easily list recipes with their docs
    - recipes have robust argument handling
    - easier and smoother integration with scripting languages
    - much fewer idiosyncracies
    - more portable (one version, more likely to work on Windows)
    - makes things more robust
    - frees up vital head space.

    You have to install it; and you lose the ability to depend on other outputs, for now.

  13. In which I share comparable make/bash scripts and a justfile, including some nifty scripts; and touch on why I've adopted just after many years with make and bash:
    news.ycombinator.com/item?id=3




  14. As a bonus for anyone using my #AdventOfCode template, I've added support for the `advent` program in my Universal Test Runner!

    This means you can run your solution by just pressing `t`!

    For anyone not using my template, you can create a #makefile or #justfile with your own command and the test runner will pick it up too!

    github.com/xavdid/universal-te

  15. @mongrelion awesome on the usage! I highly recommend reading the manual. There's a lot of capacity it provides.

    That said, do have conditional expressions you can build. However, justfile goal is to be a command runner and only that. Instead of discouraging to write a script, you can use the interpreter of whatever on it directly. Meaning you can go straight to python instead if you need a full language. Not just bash.

    just.systems/man/en/chapter_40

  16. I have converted to using instead of . It's considerably better.📈 Much like moving to from grep. Once you do the hop, it's REALLY hard not using the tool. 😎

    The biggest piece that I like is how you can use an interpreter directly for a target. Want for a target? Sure! Want Nix as a target!? Yup. 😅

    just.systems/

  17. Yesterday I lost at least 2 hours shared with another persom debugging why a simple change in a Makefile was not working of CI. In the end it was something about double dollar signs.

    Please people, technology has evolved, there's no need to keep using a bad CLang build tool to execute tasks full of .PHONY targets, just use another tool that makes it work as expected.

    #Just - github.com/casey/just | just.systems/ - is exactly that tool.

    Use #justfile instead of #makefile 😌