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

Docs: Use the correct YAML text block indicator to prevent formatting issues #11552

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion site/docs/spark-quickstart.md
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ services:
- AWS_ACCESS_KEY_ID=admin
- AWS_SECRET_ACCESS_KEY=password
- AWS_REGION=us-east-1
entrypoint: >
entrypoint: |
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indeed, > collapses the code into one line, but do we need one or multi-line here? IMHO it's one line because it's one command (/bin/sh -c "...")

Copy link
Author

@neodon neodon Nov 20, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tend to agree with you on "one line for one command". In this case, however, there is one outer command that contains multiple inner commands. So applying your criteria, would the inner commands be on separate lines?

There's also the issue of readability when my editor tries to format it. With >, it doesn't change anything because the overall value is a valid multiline block. With | and formatting, though, it becomes:

/bin/sh -c "      until (/usr/bin/mc config host add minio http://minio:9000 admin password) do echo '...waiting...' && sleep 1; done;      /usr/bin/mc rm -r --force minio/warehouse;      /usr/bin/mc mb minio/warehouse;      /usr/bin/mc policy set public minio/warehouse;      tail -f /dev/null      "

I have trouble following that result. I have to work around the problem somehow and fight my editor to keep it from changing that line. It's not a concern for everyone, but most of my projects use format-on-save.

Edit: I hope I understood your point correctly. I'll add that the block is still a valid entrypoint script and runs successfully when multiline.

/bin/sh -c "
until (/usr/bin/mc config host add minio http://minio:9000 admin password) do echo '...waiting...' && sleep 1; done;
/usr/bin/mc rm -r --force minio/warehouse;
Expand Down