casey / casey/just

ability to format imported files

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

Description

```
==> justfile <==
import 'sub.just'

main_var := 'variable'

@_:
just --list

@main:
echo main
echo {{ main_var }}

==> sub.just <==
@sub:
echo sub
echo {{ main_var }}
```

`just --fmt --unstable` will format only `justfile`

`just --fmt --unstable -f sub.just` raises an error

```
error: Variable `main_var` not defined
——▶ sub.just:4:10

4 │ echo {{ main_var }}
│ ^^^^^^^^
```

I see to ways to resolve this:

- `--fmt` should format imported files automatically
- `--fmt` can omit undefined variables and just format syntax (doesn't seem right)

Contributor guide

Open the contributing guide

Research direction

Reproduce the issue with the shown justfile and sub.just files using `just --fmt --unstable` and `just --fmt --unstable -f sub.just`. Then inspect the formatter and imported-file handling behind these CLI entry points. Done means the intended formatting behavior for imported files is implemented and the undefined `main_var` failure no longer blocks the relevant formatting workflow.

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
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.