From e7ef3e36e245fa30cab23d5802d0c701823c9ee4 Mon Sep 17 00:00:00 2001 From: Baptiste Fontaine Date: Fri, 23 Oct 2015 10:33:34 +0200 Subject: audit: merge the template comments checks Closes Homebrew/homebrew#45263. Signed-off-by: Baptiste Fontaine --- Library/Homebrew/cmd/audit.rb | 36 +++++++++++++----------------------- 1 file changed, 13 insertions(+), 23 deletions(-) diff --git a/Library/Homebrew/cmd/audit.rb b/Library/Homebrew/cmd/audit.rb index f21df6e26..bb8f8811d 100644 --- a/Library/Homebrew/cmd/audit.rb +++ b/Library/Homebrew/cmd/audit.rb @@ -609,29 +609,19 @@ class FormulaAuditor end # Comments from default template - if line =~ /# PLEASE REMOVE/ - problem "Please remove default template comments" - end - if line =~ /# Documentation:/ - problem "Please remove default template comments" - end - if line =~ /# if this fails, try separate make\/make install steps/ - problem "Please remove default template comments" - end - if line =~ /# The URL of the archive/ - problem "Please remove default template comments" - end - if line =~ /## Naming --/ - problem "Please remove default template comments" - end - if line =~ /# if your formula requires any X11\/XQuartz components/ - problem "Please remove default template comments" - end - if line =~ /# if your formula fails when building in parallel/ - problem "Please remove default template comments" - end - if line =~ /# Remove unrecognized options if warned by configure/ - problem "Please remove default template comments" + [ + "# PLEASE REMOVE", + "# Documentation:", + "# if this fails, try separate make/make install steps", + "# The URL of the archive", + "## Naming --", + "# if your formula requires any X11/XQuartz components", + "# if your formula fails when building in parallel", + "# Remove unrecognized options if warned by configure", + ].each do |comment| + if line.include? comment + problem "Please remove default template comments" + end end # FileUtils is included in Formula -- cgit v1.2.3