Merge pull request #13290 from Homebrew/style_shfmt

style: use long shfmt arguments.
This commit is contained in:
Mike McQuaid 2022-05-18 12:38:34 -04:00 committed by GitHub
commit ae9d6cbffd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -240,16 +240,8 @@ module Homebrew
files.delete(HOMEBREW_REPOSITORY/"completions/bash/brew")
files.delete(HOMEBREW_REPOSITORY/"Dockerfile")
# shfmt options:
# -i 2 : indent by 2 spaces
# -ci : indent switch cases
# -ln bash : language variant to parse ("bash")
# -w : write result to file instead of stdout (inplace fixing)
# "--" is needed for `utils/shfmt.sh`
args = ["-i", "2", "-ci", "-ln", "bash", "--", *files]
# Do inplace fixing
args.unshift("-w") if fix # need to add before "--"
args = ["--language-dialect", "bash", "--indent", "2", "--case-indent", "--", *files]
args.unshift("--write") if fix # need to add before "--"
system shfmt, *args
$CHILD_STATUS.success?