-
Notifications
You must be signed in to change notification settings - Fork 478
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
Add extensible recipe and justfile annotations #604
Comments
Good idea :3 |
I like the Rust style, because |
I think both styles are fine. The C# user base is, I believe, significantly larger than the Rust user base. So the syntax would be more familiar to more people. On the other hand The C# style makes me thing INI file and annotations should not be confused with section headers. The Rust style actually looks more like an annotation to me too. |
Just to make an arbitrary decision, let's go with Rust-style. I personally think that C# is nicer looking, but I do like that Rust-style makes it clear that they're annotations. |
I would contend that the C# style is a better choice. Everywhere else we have When using Consider: # this is an example
#[foo]
#[bar]
baz:
echo baz The attributes are obviously highlighted wrong. But also they are not clearly attributes at a glance because of the leading Compare this to: # this is an example
[foo]
[bar]
baz:
echo baz I personally find this much clearer. Visually speaking the lines containing attributes are cleanly separated from the comment as the first character of the line is |
I do think that C# attributes are more attractive, and the syntax highlighting argument is persuasive. C# uses curly braces for arrays (e.g. |
We have our first annotation, |
And we can still use |
@casey are there any discussions on doing cargo style [not(windows)]
run:
cc main.c
./a.out
[windows]
run:
cl main.c
main.exe I imagine my usecase is quite common for some when dealing with doing/avoiding setup specific to CI environments: [env_var("CI") == "true"]
run:
./do_the_ci_setup.sh
./run.sh
[not(env_var("CI") == "true")]
run:
./run.sh |
I opened #1895 to track inverted cfg style attributes |
I think that Just would benefit from syntax for annotations / attributes.
This might be used for:
@
on shebang recipes #603)@
for controlling line printing. (#[quiet]
instead of@
)I've been thinking about rust-style (
#[foo]
) or C# style ([foo]
), and I think rust style would be better, since it won't conflict with array notation ([...]
), and there's a precedent for attributes that apply to the containing item (#![foo]
).So recipe attributes would look like:
and module attributes would look like:
An initial PR need only support recipe or module attributes, not both, and could initially only support a single ident as the attribute contents.
The text was updated successfully, but these errors were encountered: