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++`.
This commit is contained in:
Mike McQuaid 2017-10-27 14:58:07 +01:00
parent 2be11f6040
commit d985838428

View File

@ -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