From bf34f2106554de49a8d64a0fc17edfb045c29f06 Mon Sep 17 00:00:00 2001 From: Mike McQuaid Date: Sun, 15 May 2022 18:28:41 -0400 Subject: [PATCH] style: use long shfmt arguments. This allows removing documentation explaining them. --- Library/Homebrew/style.rb | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/Library/Homebrew/style.rb b/Library/Homebrew/style.rb index 32ffd11ac0..3f3d7efba5 100644 --- a/Library/Homebrew/style.rb +++ b/Library/Homebrew/style.rb @@ -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?