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

Consider inverting behavior of @ on shebang recipes #603

Open
casey opened this issue Mar 6, 2020 · 2 comments
Open

Consider inverting behavior of @ on shebang recipes #603

casey opened this issue Mar 6, 2020 · 2 comments

Comments

@casey
Copy link
Owner

casey commented Mar 6, 2020

Shebang recipes are quiet by default. This is somewhat confusing, since linewise recipes are not quiet by default.

The motivation for making shebang recipes quiet is that it isn't possible to print out each line of a shebang recipe as it is executed, since the recipe is passed in its entirety to an interpreter, and printing out the whole recipe before executing it isn't particularly useful.

I'm leaning towards leaving it this way, since I think it might be better to be more useful than to be more consistent. However, I'm not sure if I'm in the minority here, so I'm interested in what other people think.

@plus7wist
Copy link

I agree that print a shebang recipe make people feel verbose, and then, I agree that we should just make shebang recipe keep quiet by default.

However, I think use @ to enable that print looks strange, because that symbol will have totally different meanings in shabang and linewise recipe. That, makes users can not know if a recipe is quiet, until he/she read both the body of a recipe (to know if this recipe is a shebang recipe), and the "title" of that (to know if it is marked by @).

I have a idea for that. We can keep a shabang recipe quiet with or without @. If we ask a quiet guy to be quiet, he/she will still quiet. And if someone want to print a shabang recipe, we add a new mark style, like @@ to make a "quiet" recipe "verbose".

shabang_task: # Default quiet
    #! /usr/bin/env python
    print('Hello')

@quiet_shabang_task: # Still quiet
    #! /usr/bin/env python
    print('Hello')

@@verbose_shabang_task: # Become Verbose
    #! /usr/bin/env python
    print('Hello')

linewise_task: # Default verbose
    echo Hello

@quiet_linewise_task: # Become quiet
    echo Hello

@@verbose_linewise_task: # Still verbose
    echo Hello

@casey
Copy link
Owner Author

casey commented Mar 9, 2020

While @@ is nice and concise, it might be hard to learn and remember what it does.

I think the right way to solve this is to add a general syntax for annotating recipes, and use that. I opened #604 to track adding the annotation syntax.

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

No branches or pull requests

2 participants