Skip to content
Snippets Groups Projects
Unverified Commit 15a2abd9 authored by Mike McQuaid's avatar Mike McQuaid
Browse files

style: re-enable shellcheck.

Ensure that `shellcheck` is run by `brew style` again and fix the
various failures.
parent 99aee978
No related branches found
No related tags found
No related merge requests found
......@@ -5,7 +5,7 @@ then
fi
# USER isn't always set so provide a fall back for `brew` and subprocesses.
export USER=${USER:-`id -un`}
export USER=${USER:-$(id -un)}
# Where we store built products; a Cellar in HOMEBREW_PREFIX (often /usr/local
# for bottles) unless there's already a Cellar in HOMEBREW_REPOSITORY.
......
......@@ -56,7 +56,7 @@ module Homebrew
File.expand_path(file).start_with? HOMEBREW_LIBRARY_PATH
end
if files && !has_non_formula
if files.present? && !has_non_formula
config = if files.first && File.exist?("#{files.first}/spec")
HOMEBREW_LIBRARY/".rubocop_rspec.yml"
else
......@@ -65,7 +65,7 @@ module Homebrew
args << "--config" << config
end
if files.nil?
if files.blank?
args << HOMEBREW_LIBRARY_PATH
else
args += files
......@@ -79,7 +79,7 @@ module Homebrew
when :print
args << "--debug" if Homebrew.args.debug?
args << "--display-cop-names" if Homebrew.args.display_cop_names?
args << "--format" << "simple" if files
args << "--format" << "simple" if files.present?
system(cache_env, "rubocop", *args)
rubocop_success = $CHILD_STATUS.success?
when :json
......@@ -100,7 +100,7 @@ module Homebrew
raise "Invalid output_type for check_style_impl: #{output_type}"
end
return rubocop_success if files.present? || !has_non_formula
return rubocop_success if files.present?
shellcheck = which("shellcheck")
shellcheck ||= which("shellcheck", ENV["HOMEBREW_PATH"])
......
......@@ -44,7 +44,7 @@ If there's no Homebrew Portable Ruby available for your processor:
then
HOMEBREW_RUBY_PATH="$vendor_ruby_path"
[[ -z "$HOMEBREW_MACOS" ]] && TERMINFO_DIRS="$vendor_ruby_terminfo"
if [[ $vendor_ruby_current_version != $vendor_ruby_latest_version ]]
if [[ $vendor_ruby_current_version != "$vendor_ruby_latest_version" ]]
then
if ! brew vendor-install ruby
then
......
......@@ -23,8 +23,8 @@ symlink_target_directory() {
builtin enable compgen unset
for cmd in $(builtin compgen -A builtin)
do
builtin unset -f $cmd
builtin enable $cmd
builtin unset -f "$cmd"
builtin enable "$cmd"
done
unset cmd
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment