diff options
| author | Gautham Goli | 2017-08-17 11:41:58 +0530 |
|---|---|---|
| committer | Gautham Goli | 2017-08-17 11:41:58 +0530 |
| commit | db20b0c281899e42d4d4bbe5a98e644e1f543df4 (patch) | |
| tree | 068be2abfbdaa23e01c5550eef70be5d34041822 /Library/Homebrew/rubocops | |
| parent | daa0ea4b8a53b3d2965b84ff673c58310a6937ed (diff) | |
| download | brew-db20b0c281899e42d4d4bbe5a98e644e1f543df4.tar.bz2 | |
audit: In Cops and their tests convert all multiline strings to heredocs
Diffstat (limited to 'Library/Homebrew/rubocops')
| -rw-r--r-- | Library/Homebrew/rubocops/patches_cop.rb | 20 | ||||
| -rw-r--r-- | Library/Homebrew/rubocops/urls_cop.rb | 6 |
2 files changed, 20 insertions, 6 deletions
diff --git a/Library/Homebrew/rubocops/patches_cop.rb b/Library/Homebrew/rubocops/patches_cop.rb index fb14d8acc..b27283382 100644 --- a/Library/Homebrew/rubocops/patches_cop.rb +++ b/Library/Homebrew/rubocops/patches_cop.rb @@ -31,7 +31,10 @@ module RuboCop %r{gist\.githubusercontent\.com/.+/raw}]) if regex_match_group(patch, gh_patch_patterns) unless patch_url =~ /[a-fA-F0-9]{40}/ - problem "GitHub/Gist patches should specify a revision:\n#{patch_url}" + problem <<-EOS.undent.chomp + GitHub/Gist patches should specify a revision: + #{patch_url} + EOS end end @@ -46,15 +49,24 @@ module RuboCop end if regex_match_group(patch, %r{macports/trunk}) - problem "MacPorts patches should specify a revision instead of trunk:\n#{patch_url}" + problem <<-EOS.undent.chomp + MacPorts patches should specify a revision instead of trunk: + #{patch_url} + EOS end if regex_match_group(patch, %r{^http://trac\.macports\.org}) - problem "Patches from MacPorts Trac should be https://, not http:\n#{patch_url}" + problem <<-EOS.undent.chomp + Patches from MacPorts Trac should be https://, not http: + #{patch_url} + EOS end return unless regex_match_group(patch, %r{^http://bugs\.debian\.org}) - problem "Patches from Debian should be https://, not http:\n#{patch_url}" + problem <<-EOS.undent.chomp + Patches from Debian should be https://, not http: + #{patch_url} + EOS end end end diff --git a/Library/Homebrew/rubocops/urls_cop.rb b/Library/Homebrew/rubocops/urls_cop.rb index 676e73523..071a4c42d 100644 --- a/Library/Homebrew/rubocops/urls_cop.rb +++ b/Library/Homebrew/rubocops/urls_cop.rb @@ -104,8 +104,10 @@ module RuboCop end if url =~ %r{^https?://prdownloads\.} - problem "Don't use prdownloads in SourceForge urls (url is #{url}).\n" \ - "\tSee: http://librelist.com/browser/homebrew/2011/1/12/prdownloads-is-bad/" + problem <<-EOS.undent.chomp + Don't use prdownloads in SourceForge urls (url is #{url}). + See: http://librelist.com/browser/homebrew/2011/1/12/prdownloads-is-bad/ + EOS end if url =~ %r{^http://\w+\.dl\.} |
