Skip to content

Commit

Permalink
Merge pull request #7930 from MikeMcQuaid/shellcheck
Browse files Browse the repository at this point in the history
style: re-enable shellcheck.
  • Loading branch information
MikeMcQuaid committed Jul 7, 2020
2 parents 0fa5cc6 + 15a2abd commit b9e2b82
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion Library/Homebrew/brew.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
8 changes: 4 additions & 4 deletions Library/Homebrew/style.rb
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ def check_style_impl(files, output_type, fix: false, except_cops: nil, only_cops
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
Expand All @@ -65,7 +65,7 @@ def check_style_impl(files, output_type, fix: false, except_cops: nil, only_cops
args << "--config" << config
end

if files.nil?
if files.blank?
args << HOMEBREW_LIBRARY_PATH
else
args += files
Expand All @@ -79,7 +79,7 @@ def check_style_impl(files, output_type, fix: false, except_cops: nil, only_cops
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
Expand All @@ -100,7 +100,7 @@ def check_style_impl(files, output_type, fix: false, except_cops: nil, only_cops
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"])
Expand Down
2 changes: 1 addition & 1 deletion Library/Homebrew/utils/ruby.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions bin/brew
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit b9e2b82

Please sign in to comment.