Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cmd/audit: only flush formulary cache when needed #15987

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 3 additions & 1 deletion Library/Homebrew/dev-cmd/audit.rb
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,8 @@
spdx_license_data = SPDX.license_data
spdx_exception_data = SPDX.exception_data

clear_formulary_cache = [args.os, args.arch].any?

Check warning on line 190 in Library/Homebrew/dev-cmd/audit.rb

View check run for this annotation

Codecov / codecov/patch

Library/Homebrew/dev-cmd/audit.rb#L190

Added line #L190 was not covered by tests

formula_problems = audit_formulae.sort.each_with_object({}) do |f, problems|
path = f.path

Expand All @@ -208,7 +210,7 @@
SimulateSystem.with os: os, arch: arch do
odebug "Auditing Formula #{f} on os #{os} and arch #{arch}"

Formulary.clear_cache
Formulary.clear_cache if clear_formulary_cache

audit_proc = proc { FormulaAuditor.new(Formulary.factory(path), **options).tap(&:audit) }

Expand Down