Merge pull request #1868 from zmwangx/bottle-add-improve-regexp

bottle: add: improve regexp to recognize comments
This commit is contained in:
Mike McQuaid 2017-01-18 08:02:45 +00:00 committed by GitHub
commit 9f183be358
2 changed files with 2 additions and 1 deletions

View File

@ -66,7 +66,7 @@ Metrics/BlockNesting:
# Offense count: 19 # Offense count: 19
# Configuration parameters: CountComments. # Configuration parameters: CountComments.
Metrics/ModuleLength: Metrics/ModuleLength:
Max: 363 Max: 400
# Offense count: 1 # Offense count: 1
# Configuration parameters: CountKeywordArgs. # Configuration parameters: CountKeywordArgs.

View File

@ -435,6 +435,7 @@ module Homebrew
else else
string = s.sub!( string = s.sub!(
/( /(
(\ {2}\#[^\n]*\n)* # comments
\ {2}( # two spaces at the beginning \ {2}( # two spaces at the beginning
(url|head)\ ['"][\S\ ]+['"] # url or head with a string (url|head)\ ['"][\S\ ]+['"] # url or head with a string
( (