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

Format shell scripts using shfmt #1638

Merged
merged 2 commits into from
Sep 23, 2024
Merged

Format shell scripts using shfmt #1638

merged 2 commits into from
Sep 23, 2024

Conversation

edmorley
Copy link
Member

@edmorley edmorley commented Sep 23, 2024

Shell scripts are now formatted using shfmt:
https://github.com/mvdan/sh/blob/master/cmd/shfmt/shfmt.1.scd

This is enforced in CI, and formatting can be applied locally using a new make format target.

Notably, this also reformats the scripts to use tabs instead of spaces, since sadly tabs are the only way to be able to properly indent bash here documents (which is something the scripts here will be using a lot of soon) without having to resort to mixed tabs and spaces indentation in the same file. (Plus tabs is also the shfmt default style.)

Prep for #796 / #932.

GUS-W-16808198.

@edmorley edmorley self-assigned this Sep 23, 2024
@edmorley edmorley force-pushed the shfmt branch 3 times, most recently from 2eabbcc to 7d20dd5 Compare September 23, 2024 10:24
Shell scripts are now formatted using shfmt:
https://github.com/mvdan/sh/blob/master/cmd/shfmt/shfmt.1.scd

This is enforced in CI, and formatting can be applied locally
using a new `make format` target.

Notably, this also reformats the scripts to use tabs instead of spaces,
since tabs are sadly the only way to be able to properly indent bash
here documents (which is something the scripts here will be using a
lot of soon) without having to resort to mixed tabs and spaces
indentation in the same file. (Plus tabs is also the shfmt default style.)

GUS-W-16808198.
@edmorley edmorley marked this pull request as ready for review September 23, 2024 10:34
@edmorley edmorley requested a review from a team as a code owner September 23, 2024 10:34
@edmorley edmorley enabled auto-merge (squash) September 23, 2024 10:35
@edmorley edmorley merged commit 3da3b3a into main Sep 23, 2024
7 checks passed
@edmorley edmorley deleted the shfmt branch September 23, 2024 12:25
@heroku-linguist heroku-linguist bot mentioned this pull request Sep 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants