Skip when the resource name is the same as the formula name
- Otherwise we get an audit failure in, for example, the `twine-pypi` formula for the package name from its `url` that's actually `twine`. - For this we only should track `resource "name"` blocks.
This commit is contained in:
parent
bb44d66e79
commit
08f58ab5f7
@ -102,6 +102,7 @@ module Homebrew
|
||||
|
||||
def audit_resource_name_matches_pypi_package_name_in_url
|
||||
return unless url.match?(%r{^https?://files\.pythonhosted\.org/packages/})
|
||||
return if name == owner.name # Skip the top-level package name as we only care about `resource "foo"` blocks.
|
||||
|
||||
pypi_package_name = url.split("/").last.split(/[-.]\d+?./).first.gsub(/[_.]/, "-")
|
||||
return if name.casecmp(pypi_package_name).zero?
|
||||
|
Loading…
x
Reference in New Issue
Block a user