aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMike McQuaid2017-10-27 14:58:07 +0100
committerMike McQuaid2017-10-27 14:58:07 +0100
commitd98583842813480262afc4461f14ae51020f4299 (patch)
tree38930b890d8450ec5b298347c338306de2d85555
parent2be11f604005ea20b582cec2daea2315ec867f66 (diff)
downloadbrew-d98583842813480262afc4461f14ae51020f4299.tar.bz2
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++`.
-rw-r--r--Library/Homebrew/rubocops/lines_cop.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/Library/Homebrew/rubocops/lines_cop.rb b/Library/Homebrew/rubocops/lines_cop.rb
index e8aa6a53f..af7e1338e 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