formula_cellar_checks: skip unless Python libs

This avoids an unusual error message when Python is needed for building
(e.g., code generation) but is not used at runtime.

```
==> brew audit recode --online
Error: 1 problem in 1 formula detected
recode:
  * Packages have been installed for:

    but this formula depends on:
      Python 3.7
```
This commit is contained in:
Jonathan Chang 2020-04-04 15:49:30 +11:00
parent 0859115a24
commit 2c85f26b0b

View File

@ -180,6 +180,8 @@ module FormulaCellarChecks
match.captures.first match.captures.first
end.compact end.compact
return if pythons.blank?
python_deps = deps.map(&:name) python_deps = deps.map(&:name)
.grep(/^python(@.*)?$/) .grep(/^python(@.*)?$/)
.map { |d| Formula[d].version.to_s[/^\d+\.\d+/] } .map { |d| Formula[d].version.to_s[/^\d+\.\d+/] }