casey / casey/just

Allow setting duplicate settings

Open
#2,563 7 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 got two justfiles across related projects. Each should work on their own, but the child imports the parent for extra (optional) functionality. It's roughly:

```just
# ~/parent/justfile
base:
echo "in base!"

# ~/child/justfile
import? '../parent/justfile'
child:
echo "in child!"
```

And it works great!

But, I want to set `quiet` in both files. If I _always_ used `child` when `parent` was present, then I could just piggyback on a definition in parent. Or, exclude it from parent and set it in each child. But, since each justfile should work independently, I find myself wanting to set it in both places. Today, I get an error:

```
Setting `quiet` first set on line 1 is redefined on line 4
```

I'd expect it to follow the existing `allow-duplicate-variables` behavior: last setting wins.

Is this sort of thing possible today? Alternatively, would you be open to a PR?

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.