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

shfmt files #351

Merged
merged 1 commit into from
Jul 2, 2020
Merged

shfmt files #351

merged 1 commit into from
Jul 2, 2020

Conversation

nemchik
Copy link
Collaborator

@nemchik nemchik commented Jul 1, 2020

I ran:

docker run --rm -v ${PWD}:${PWD} mvdan/shfmt -s -i 2 -ci -sr -w ${PWD}/.automation/*.sh
docker run --rm -v ${PWD}:${PWD} mvdan/shfmt -s -i 2 -ci -sr -w ${PWD}/.vscode/*.sh
docker run --rm -v ${PWD}:${PWD} mvdan/shfmt -s -i 2 -ci -sr -w ${PWD}/lib/*.sh

(does not recurse through subfolders, so the intentionally bad shell files for test purposes are untouched)

This is just a code formatter. It can be used as a linter as well (I've mentioned it in some issue discussion). Most of the changes are whitespace changes. Generally all of the changes are meant to improve readability and ensure the shell (bash) does not incorrectly interpret anything.

If there are any specific questions feel free to comment inline.

I won't be too hurt if this doesn't merge. It took seconds to create this branch, and a valid reason for NOT merging it would be that this style of formatting would not be enforced in the future (unless it were to be mandated via pre-commit hooks or GHA checks). But it can still carry value as a one-off.

Copy link
Collaborator

@admiralAwkbar admiralAwkbar left a comment

Choose a reason for hiding this comment

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

I really like the cleanup of the code! It seems to be all spacing fixes and cleanup of some formatting. The only thing is just the de-quoting of some of the vars... I understand that you should quote the vars to prevent parameter expansion issues, but it's not complaining about some of them being unquoted...

@nemchik
Copy link
Collaborator Author

nemchik commented Jul 2, 2020

I really like the cleanup of the code! It seems to be all spacing fixes and cleanup of some formatting. The only thing is just the de-quoting of some of the vars... I understand that you should quote the vars to prevent parameter expansion issues, but it's not complaining about some of them being unquoted...

See https://github.com/github/super-linter/pull/351#discussion_r448993344

@nemchik
Copy link
Collaborator Author

nemchik commented Jul 2, 2020

P.S. I use https://marketplace.visualstudio.com/items?itemName=foxundermoon.shell-format and install shfmt from https://github.com/mvdan/sh either natively on linux or using https://scoop.sh/ on windows. I would use chocolatey but there is no package for shfmt in the chocolatey repositories.

@admiralAwkbar admiralAwkbar self-requested a review July 2, 2020 14:32
@admiralAwkbar admiralAwkbar self-assigned this Jul 2, 2020
Copy link
Collaborator

@admiralAwkbar admiralAwkbar left a comment

Choose a reason for hiding this comment

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

Dope

@admiralAwkbar admiralAwkbar merged commit bd83a8a into super-linter:master Jul 2, 2020
@nemchik nemchik deleted the shfmt branch July 2, 2020 14:45
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

Successfully merging this pull request may close these issues.

None yet

2 participants