casey / casey/just

Consider adding a setting which causes backticks and `shell()` calls to execute during `--dry-run`

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

Description

Apropos of #3586.

Currently, `--dry-run` causes just to skip running recipes, backticks, and `shell()` calls. Backticks and shell calls evaluate to a string containing the command. This can cause problems when the these values are used in other expressions, for example, `bool()` which can error on unexpected input, halting the run.

For example, running `foo` in this justfile will fail during `--dry-run`:

```just
foo bar=bool(`echo 1`):
```

Since the backtick will evaluate to the string:

```
"`echo 1`"
```

Which is an error to pass to bool.

We could introduce a setting which caused backticks and `shell()` calls to run, even during `--dry-run`, so avoid this issue. It would have to be opt-in, since users may be relying on `--dry-run` not running such commands.

This feels perhaps a little too niche to be worth it, but I wanted to create this issue to collect feedback.

Contributor guide

Open the contributing guide

Research direction

Start by tracing the --dry-run handling for recipes, backticks, and shell() calls, using the context from issue #3586. Define the opt-in setting's behavior and verify that it allows these expressions to produce command output during dry runs without changing the default behavior; cover the example involving bool(`echo 1`).

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
cli
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.