audit: add bottle modifier checks
* Checks for placement of the bottle modifier variable. * Checks there isn't a bottle modifier and a bottle do block - The former makes the latter redundant. Closes Homebrew/homebrew#45146. Signed-off-by: Dominyk Tiller <dominyktiller@gmail.com>
This commit is contained in:
parent
674a350e6c
commit
2b9561b837
@ -172,11 +172,12 @@ class FormulaAuditor
|
|||||||
[/^ bottle do/, "bottle block"],
|
[/^ bottle do/, "bottle block"],
|
||||||
[/^ devel do/, "devel block"],
|
[/^ devel do/, "devel block"],
|
||||||
[/^ head do/, "head block"],
|
[/^ head do/, "head block"],
|
||||||
|
[/^ bottle (:unneeded|:disable)/, "bottle modifier"],
|
||||||
[/^ option/, "option"],
|
[/^ option/, "option"],
|
||||||
[/^ depends_on/, "depends_on"],
|
[/^ depends_on/, "depends_on"],
|
||||||
[/^ def install/, "install method"],
|
[/^ def install/, "install method"],
|
||||||
[/^ def caveats/, "caveats method"],
|
[/^ def caveats/, "caveats method"],
|
||||||
[/^ test do/, "test block"]
|
[/^ test do/, "test block"],
|
||||||
]
|
]
|
||||||
|
|
||||||
present = component_list.map do |regex, name|
|
present = component_list.map do |regex, name|
|
||||||
@ -193,6 +194,9 @@ class FormulaAuditor
|
|||||||
if present.include?("head") && present.include?("head block")
|
if present.include?("head") && present.include?("head block")
|
||||||
problem "Should not have both `head` and `head do`"
|
problem "Should not have both `head` and `head do`"
|
||||||
end
|
end
|
||||||
|
if present.include?("bottle modifier") && present.include?("bottle block")
|
||||||
|
problem "Should not have `bottle :unneeded/:disable` and `bottle do`"
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def audit_class
|
def audit_class
|
||||||
|
Loading…
x
Reference in New Issue
Block a user