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

Add option to show recipe's description when running it - useful for CI #1909

Closed
nyurik opened this issue Feb 19, 2024 · 3 comments
Closed

Comments

@nyurik
Copy link
Contributor

nyurik commented Feb 19, 2024

When running just recipes in CI, it might be good to print a description of each recipe before running it - by using some new optional flag, or maybe as part of the --verbose. This way anyone examining CI logs would have a better understanding of what each step is for, and possibly have some hints on how to fix it if it breaks

@laniakea64
Copy link
Contributor

As a workaround, you can achieve it this way, but a built-in optional feature would definitely be nicer.

# Performs foo task.
foo:
	@{{ if env("IS_CI", '') == '1' { \
	  quote(just_executable()) + ' -f ' + quote(justfile()) + " --list | \
	    grep -P '^ *foo ' | sed -Ee 's/^[^#]+# *//g'" \
	  } else { "" } \
	}}
	echo 'Running the recipe...'

This example prints recipe description only when running in CI that sets the example IS_CI environment variable to 1.

@casey
Copy link
Owner

casey commented May 15, 2024

I think that would be useful. I think probably landing it as a new flag, maybe --explain, and then later think about whether or not it should be the default when --verbose is used.

@casey
Copy link
Owner

casey commented Aug 29, 2024

Done in #2319!

@casey casey closed this as completed Aug 29, 2024
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

3 participants