formula_auditor: Correct safe navigation positioning

Co-authored-by: Mike McQuaid <mike@mikemcquaid.com>
This commit is contained in:
Issy Long 2023-03-22 13:43:33 +00:00 committed by GitHub
parent 13fe1bb4b4
commit 21f38ca3af
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -470,7 +470,7 @@ module Homebrew
return unless @core_tap return unless @core_tap
return unless formula.keg_only? return unless formula.keg_only?
keg_only_message = text.to_s.match(/keg_only\s+["'](.*)["']/).captures&.first keg_only_message = text.to_s.match(/keg_only\s+["'](.*)["']/)&.captures.first
return unless keg_only_message&.include?("HOMEBREW_PREFIX") return unless keg_only_message&.include?("HOMEBREW_PREFIX")
problem "`keg_only` reason should not include `HOMEBREW_PREFIX` as it creates confusing `brew info` output." problem "`keg_only` reason should not include `HOMEBREW_PREFIX` as it creates confusing `brew info` output."