audit: recommend use of assert_match.
It produces significantly easier output to debug than doing `assert` and `.include?` (which just shows if it passed or failed). Closes Homebrew/homebrew#41662. Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
This commit is contained in:
parent
b554c8bcca
commit
24b0639e27
@ -794,6 +794,10 @@ class FormulaAuditor
|
||||
problem "Use the `#{method}` Ruby method instead of `system #{system}`"
|
||||
end
|
||||
|
||||
if line =~ /assert .*\.include?/
|
||||
problem "Use `assert_match` instead of `assert ...include?`"
|
||||
end
|
||||
|
||||
if @strict
|
||||
if line =~ /system (["'][^"' ]*(?:\s[^"' ]*)+["'])/
|
||||
bad_system = $1
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user