aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
Diffstat (limited to 'Library')
-rw-r--r--Library/Homebrew/dev-cmd/audit.rb4
-rw-r--r--Library/Homebrew/test/audit_test.rb5
2 files changed, 9 insertions, 0 deletions
diff --git a/Library/Homebrew/dev-cmd/audit.rb b/Library/Homebrew/dev-cmd/audit.rb
index b5dc4ecb1..d10ff51f4 100644
--- a/Library/Homebrew/dev-cmd/audit.rb
+++ b/Library/Homebrew/dev-cmd/audit.rb
@@ -584,6 +584,10 @@ class FormulaAuditor
problem "Please use https:// for #{homepage}"
end
+ if homepage =~ %r{^http://([^/]*)\.(sf|sourceforge)\.net(/|$)}
+ problem "#{homepage} should be `https://#{$1}.sourceforge.io/`"
+ end
+
# There's an auto-redirect here, but this mistake is incredibly common too.
# Only applies to the homepage and subdomains for now, not the FTP URLs.
if homepage =~ %r{^http://((?:build|cloud|developer|download|extensions|git|glade|help|library|live|nagios|news|people|projects|rt|static|wiki|www)\.)?gnome\.org}
diff --git a/Library/Homebrew/test/audit_test.rb b/Library/Homebrew/test/audit_test.rb
index 60cf27610..b1ccb1e10 100644
--- a/Library/Homebrew/test/audit_test.rb
+++ b/Library/Homebrew/test/audit_test.rb
@@ -431,6 +431,9 @@ class FormulaAuditorTests < Homebrew::TestCase
"corge" => "http://savannah.nongnu.org/corge",
"grault" => "http://grault.github.io/",
"garply" => "http://www.gnome.org/garply",
+ "sf1" => "http://foo.sourceforge.net/",
+ "sf2" => "http://foo.sourceforge.net",
+ "sf3" => "http://foo.sf.net/",
"waldo" => "http://www.gnu.org/waldo",
}
@@ -455,6 +458,8 @@ class FormulaAuditorTests < Homebrew::TestCase
end
elsif homepage =~ %r{https:\/\/code\.google\.com}
assert_match "#{homepage} should end with a slash", fa.problems.first
+ elsif homepage =~ /foo\.(sf|sourceforge)\.net/
+ assert_match "#{homepage} should be `https://foo.sourceforge.io/`", fa.problems.first
else
assert_match "Please use https:// for #{homepage}", fa.problems.first
end