style: add shfmt exit status to brew style

This commit is contained in:
XuehaiPan 2021-09-16 23:42:30 +08:00
parent 065c5b79fe
commit 966189d07d

View File

@ -65,12 +65,16 @@ module Homebrew
run_shellcheck(shell_files, output_type) run_shellcheck(shell_files, output_type)
end end
run_shfmt(shell_files, fix: fix) if ruby_files.none? || shell_files.any? shfmt_result = if ruby_files.any? && shell_files.none?
true
else
run_shfmt(shell_files, fix: fix)
end
if output_type == :json if output_type == :json
Offenses.new(rubocop_result + shellcheck_result) Offenses.new(rubocop_result + shellcheck_result)
else else
rubocop_result && shellcheck_result rubocop_result && shellcheck_result && shfmt_result
end end
end end