casey / casey/just

Add ability to add new dependency without clobbering rule

Open
#2,270 6 comments 1 reaction 0 assignees View on GitHub
Dominant language
Rust
Stars
35.8k
Forks
846
Avg merge
27m
Merged PRs (30d)
3

Description

I've been following `just` development for years (and package it for Arch Linux) but I have been so deeply invested in GNU Make/Autotools that I haven't actually started using it. I just made an attempt to port some of the `.PHONY` rules from one of my projects that are more task that build oriented, but ran up against an issue. One of the things I was hoping to do is keep the whole setup modular enough that I could reuse bits across projects using includes. I already do this with Make both with by own macros and the autoconf archive. This doesn't seem to be possible with Just yet.

It's easy to setup a module and include it, and of course the new rules become available, but it doesn't seem possible to append new dependencies to existing tasks this way. Extrapolating from how I would do this with `make`, I expected something like this to work:

Module file `foo.just`:

```just
lint-foo:
echo new linter

lint: lint-foo
```

Main `Justfile`:

```just
import 'foo.just'

lint:
echo base linter
```

This doesn't work. Even with `set allow-duplicate-recipes` this just clobbers the recipe instead of adding a new dependency to it like `make` would do.

I considered adding all "lint"ish recipes to a group, but that only seems to help with listing them with `just --list`, it does not provide a way to execute all results from a group at once.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.