Merge pull request #1955 from vszakats/patch-2
audit: enforce https://*.sourceforge.io/ homepages
This commit is contained in:
commit
1292a4b219
@ -584,6 +584,10 @@ class FormulaAuditor
|
|||||||
problem "Please use https:// for #{homepage}"
|
problem "Please use https:// for #{homepage}"
|
||||||
end
|
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.
|
# 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.
|
# 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}
|
if homepage =~ %r{^http://((?:build|cloud|developer|download|extensions|git|glade|help|library|live|nagios|news|people|projects|rt|static|wiki|www)\.)?gnome\.org}
|
||||||
|
|||||||
@ -431,6 +431,9 @@ class FormulaAuditorTests < Homebrew::TestCase
|
|||||||
"corge" => "http://savannah.nongnu.org/corge",
|
"corge" => "http://savannah.nongnu.org/corge",
|
||||||
"grault" => "http://grault.github.io/",
|
"grault" => "http://grault.github.io/",
|
||||||
"garply" => "http://www.gnome.org/garply",
|
"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",
|
"waldo" => "http://www.gnu.org/waldo",
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -455,6 +458,8 @@ class FormulaAuditorTests < Homebrew::TestCase
|
|||||||
end
|
end
|
||||||
elsif homepage =~ %r{https:\/\/code\.google\.com}
|
elsif homepage =~ %r{https:\/\/code\.google\.com}
|
||||||
assert_match "#{homepage} should end with a slash", fa.problems.first
|
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
|
else
|
||||||
assert_match "Please use https:// for #{homepage}", fa.problems.first
|
assert_match "Please use https:// for #{homepage}", fa.problems.first
|
||||||
end
|
end
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user