Skip to content
Snippets Groups Projects
Commit 4c80bf43 authored by Andrew Janke's avatar Andrew Janke Committed by Baptiste Fontaine
Browse files

audit: add check for 'head' and 'head do' both present


Closes Homebrew/homebrew#44626.

Signed-off-by: default avatarBaptiste Fontaine <batifon@yahoo.fr>
parent 2d60187e
No related branches found
No related tags found
No related merge requests found
......@@ -179,15 +179,20 @@ class FormulaAuditor
[/^ test do/, "test block"]
]
component_list.map do |regex, name|
present = component_list.map do |regex, name|
lineno = text.line_number regex
next unless lineno
[lineno, name]
end.compact.each_cons(2) do |c1, c2|
end.compact
present.each_cons(2) do |c1, c2|
unless c1[0] < c2[0]
problem "`#{c1[1]}` (line #{c1[0]}) should be put before `#{c2[1]}` (line #{c2[0]})"
end
end
present.map!(&:last)
if present.include?("head") && present.include?("head block")
problem "Should not have both `head` and `head do`"
end
end
def audit_class
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment