Skip to content

Format shell scripts using shfmt#1638

Merged
edmorley merged 2 commits intomainfrom
shfmt
Sep 23, 2024
Merged

Format shell scripts using shfmt#1638
edmorley merged 2 commits intomainfrom
shfmt

Conversation

@edmorley
Copy link
Copy Markdown
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
@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