Merge branch 'master' into shellcheck-autofix

This commit is contained in:
Xuehai Pan 2021-11-08 12:02:54 +08:00 committed by GitHub
commit a56ab26e88
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -169,19 +169,28 @@ module Homebrew
files = files.map(&:realpath) files = files.map(&:realpath)
args = ["--shell=bash", "--enable=all", "--external-sources", "--source-path=#{HOMEBREW_LIBRARY}", "--"] args = [
"--shell=bash",
"--enable=all",
"--external-sources",
"--source-path=#{HOMEBREW_LIBRARY}",
# TODO: fix these
"--exclude=SC2310,SC2311,SC2312",
"--",
*files,
]
if fix if fix
patch = system_command shellcheck, args: ["--format=diff", *args, *files] patch = system_command shellcheck, args: ["--format=diff", *args]
system_command "patch", args: ["-d", "/", "-p0"], input: patch.stdout system_command "patch", args: ["-d", "/", "-p0"], input: patch.stdout
end end
case output_type case output_type
when :print when :print
system shellcheck, "--format=tty", *args, *files system shellcheck, "--format=tty", *args
$CHILD_STATUS.success? $CHILD_STATUS.success?
when :json when :json
result = system_command shellcheck, args: ["--format=json", *args, *files] result = system_command shellcheck, args: ["--format=json", *args]
json = json_result!(result) json = json_result!(result)
# Convert to same format as RuboCop offenses. # Convert to same format as RuboCop offenses.