Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ability to format imported files #1824

Open
bobelev opened this issue Jan 8, 2024 · 1 comment
Open

ability to format imported files #1824

bobelev opened this issue Jan 8, 2024 · 1 comment

Comments

@bobelev
Copy link

bobelev commented Jan 8, 2024

==> 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)
@bobelev
Copy link
Author

bobelev commented Feb 8, 2024

Now we can't even format files with common recipes that don't have variable declaration:

❯ just --fmt -f sub.just  --set main_var "123"
error: `--format` used with unexpected overrides: `main_var=123`

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant