shell_style() {
  shfmt_args="--indent 2 --simplify --language-dialect=bash"

  if [ -n "${STYLE_FIX-}" ]; then
    for file in "$@"; do
      # Want to expand shfmt_args
      # shellcheck disable=SC2086
      shfmt ${shfmt_args} --write "${file}" "${file}"
      shellcheck --format=diff "${file}" | patch -p1
    done
  fi

  # Want to expand shfmt_args
  # shellcheck disable=SC2086
  shfmt ${shfmt_args} --diff "$@"

  shellcheck "$@"
}