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

Multi line documentation comment #1337

Closed
hyzyla opened this issue Sep 8, 2022 · 4 comments
Closed

Multi line documentation comment #1337

hyzyla opened this issue Sep 8, 2022 · 4 comments

Comments

@hyzyla
Copy link

hyzyla commented Sep 8, 2022

I have such recipe

# Build python image for ARM arhcitecture. 
#
# We are building directly by docker command, because docker-compsoe doesn't support 
# different Dockerfiles for different processor architectures
build-python-arm-image:
    docker build --file config/docker/py.ARM.dockerfile --target dev --tag my-image .

What I was expected to see in documentation:

# just --list
Available recipes:
    build-python-arm-image # Build python image for ARM arhcitecture.

What I've got:

# just --list
Available recipes:
    build-python-arm-image # different Dockerfiles for different processor architectures

Is it possible to add support for multiline documentation comments, in such way that first line or all lines should be presented in documenation?

@casey
Copy link
Owner

casey commented Sep 21, 2022

It's a bit awkward, but you could do this:

# We are building directly by docker command, because docker-compsoe doesn't support 
# different Dockerfiles for different processor architectures
#
# Build python image for ARM architecture. 
build-python-arm-image:
    docker build --file config/docker/py.ARM.dockerfile --target dev --tag my-image .

It's definitely not ideal!

We could change doc comments to use the first comment line, instead of the last. Or to use all lines. Someone would have to survey justfiles on GitHub and see how disruptive this would be. I'd be open to it, if it wouldn't be super disruptive, since it wouldn't actually break anything.

@runeimp
Copy link

runeimp commented Sep 21, 2022

Sound like another good candidate for the Just Editions concept

@casey
Copy link
Owner

casey commented Sep 22, 2022

@runeimp Definitely. In fact, there are few things that I'd like to reform about doc-comments:

#553
#1273
#495

@casey
Copy link
Owner

casey commented May 25, 2024

Better late than never! #2050 added a [doc] attribute, so you can set a recipe's doc comment with [doc(STRING)] and string can be multiple lines, which will override any # … comments, if present.

@casey casey closed this as completed May 25, 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