From d98583842813480262afc4461f14ae51020f4299 Mon Sep 17 00:00:00 2001 From: Mike McQuaid Date: Fri, 27 Oct 2017 14:58:07 +0100 Subject: [PATCH] lines_cop: add missing e.g. clang++ regex SOL. You need a start of line check in this regex (like was added in the others) to allow things like `#{bin}/clang++`. --- Library/Homebrew/rubocops/lines_cop.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Library/Homebrew/rubocops/lines_cop.rb b/Library/Homebrew/rubocops/lines_cop.rb index e8aa6a53f6..af7e1338e4 100644 --- a/Library/Homebrew/rubocops/lines_cop.rb +++ b/Library/Homebrew/rubocops/lines_cop.rb @@ -178,7 +178,7 @@ module RuboCop param = parameters(method).first if match = regex_match_group(param, %r{^(/usr/bin/)?(gcc|llvm-gcc|clang)\s?}) problem "Use \"\#{ENV.cc}\" instead of hard-coding \"#{match[2]}\"" - elsif match = regex_match_group(param, %r{(/usr/bin/)?((g|llvm-g|clang)\+\+)\s?}) + elsif match = regex_match_group(param, %r{^(/usr/bin/)?((g|llvm-g|clang)\+\+)\s?}) problem "Use \"\#{ENV.cxx}\" instead of hard-coding \"#{match[2]}\"" end end