716 Commits

Author SHA1 Message Date
Bo Anderson
3c9eb901db
dev-cmd/audit: fix for Ruby 3 2023-10-30 21:21:30 +00:00
Bo Anderson
26ea6b7f9e
Pull in REXML gem as it doesn't ship with Ruby 3 2023-10-27 20:24:10 +01:00
apainintheneck
5859fcce44 dev-cmd/audit: load formulae from files
This is a test to see if this will fix some flaky checks on CI
that are caused by missing formulae while auditing the core tap.

- https://github.com/Homebrew/brew/issues/16037
2023-09-26 20:37:41 -07:00
apainintheneck
d63e8cde80 cmd/audit: only flush formulary cache when needed
The cache here needs to be cleared when we are auditing multiple
os/arch combinations but not when we are running the audit only
for the current os/arch combination. This gives a 2x speed boost
to `brew audit --skip-style --except-version --tap=homebrew/core` locally.

In theory we could clear the cache less often by running all audits for
one os/arch combination at a time when auditing multiple os/arch combinations.
This would make the output a bit harder to follow and we don't seem to
run those checks on CI so I'm skipping that for now.
2023-09-09 18:47:29 -07:00
apainintheneck
1dc9274f62 Improve cask audit
- check for cask.url in audit steps
- check for cask.version in audit steps
- check for cask.sha256 in fetch command
- stop omitting casks based on nil url in audit command

It would be nice to be able to omit casks from the audit
if the os is not supported but there is not easy way to
do that without updating the SimulateSystem code or
refactoring how MacOSRequirement's are defined in the DSL.
2023-09-07 20:38:17 -07:00
apainintheneck
f4b15e95ac cmd/fetch & cmd/audit: handle unsupported os/arch combos
It's possible for casks to only run on certain os/arch
combinations but we don't check for them in the fetch and
audit commands.

At first, I tried to check if the macos version was satisfied
in a previous PR but that doesn't work correctly because
MacOSRequirement and ArchRequirement don't respect SimulateSystem.

Instead I'm just checking to see if the url stanza is defined
for each os/arch combination and skipping those casks where
it ends up being nil. This is kind of brute forcing it but
should work.
2023-09-04 15:00:31 -07:00
hyuraku
adc2a2fea1 remove ARGV from Formula#all 2023-09-02 19:35:22 +09:00
Mike McQuaid
7da934f7e2
Deprecate/disable/delete code.
The next release after this is merged will be 4.1.0.

Co-authored-by: Markus Reiter <me@reitermark.us>
2023-07-06 16:56:20 +01:00
Bo Anderson
367f716a08
dev-cmd/audit: don't audit every tap with given named packages 2023-07-04 16:08:04 +01:00
Bo Anderson
bb7aef85db
Migrate remaining no-api commands to new scoped system 2023-06-22 17:11:20 +01:00
Bo Anderson
68289f1165
Add without_api specifier for CLI named args 2023-06-22 01:57:28 +01:00
Carlo Cabrera
c5fe2a3559
formula_auditor: adjust deps audit for a staging branch
1. Adjust audit so that it ignore conflicts only for `brew audit --tap`.
   This is useful because it prevents us from trying to migrate a formula
   to `openssl@3` before all its dependencies have also been migrated.
2. Exempt only PRs that target a branch called
   `openssl-migration-staging`.
2023-06-20 22:37:06 +08:00
Markus Reiter
7cc1b6191e
Clean up brew audit output. 2023-05-19 19:40:37 +02:00
Markus Reiter
486c3765ce
Add --os=all and --arch=all options. 2023-05-17 15:26:46 +02:00
Markus Reiter
c5926241a8
Don't fail auditing empty tap. 2023-05-11 21:52:36 +02:00
Douglas Eichelberger
24cf6076e8 brew style --fix 2023-04-24 20:42:39 -07:00
Carlo Cabrera
f4692ddb40
dev-cmd/audit: fix audit annotations
Emitting annotations currently produces:

    Error: no implicit conversion of Symbol into Integer

The issue is that `problem` is an `Array` of problems which we need to
handle individually.
2023-04-22 15:13:35 +08:00
Mike McQuaid
2ca3f73078
dev-cmd/audit: remove unused warnings key.
These are now all errors so the code can be simplified.
2023-04-19 16:09:45 +01:00
Mike McQuaid
0b4c0350c2
Merge pull request #15201 from hyuraku/remove_cask/cmd/audit
remove `cask/cmd/audit`
2023-04-19 10:01:06 +01:00
hyuraku
54ce31e0fe remove auditing = true 2023-04-15 10:05:58 +09:00
hyuraku
98ec60c15e remove nil param 2023-04-13 19:02:20 +09:00
Markus Reiter
66d80cb114
Allow running audit for different architecture. 2023-04-12 21:46:48 +02:00
hyuraku
b8f18309c3 repair variable 2023-04-12 22:23:08 +09:00
hyuraku
acca57a2d8 repair cask_results query 2023-04-12 21:59:28 +09:00
hyuraku
f7b51d8cd1 pass opitions as named parameters 2023-04-12 20:16:10 +09:00
hyuraku
4999639140 - remove cask/cmd/audit
- repair cmd/audit
2023-04-11 23:06:01 +09:00
Issy Long
41466025cc
dev-cmd/style: Properly clean up the --display-cop-names option
- I remember making these changes as part of the RuboCop bump
  Dependabot PR (15136), but I must have not actually pushed them. Odd.
2023-04-11 00:19:09 +01:00
Issy Long
8319c8f9b9
Make audit_casks return [path, { errors:, warnings:}] for CI
- This was failing but only in CI because the annotations require
  "errors" and "warnings" hash elements. Since formulae have this
  despite formulae not having warnings (probably for compatibility with
  casks), I decided to reinstate `errors` and `warnings` hash for Casks
  _right at the end_ and we can clean this up another time (famous last
  words).
2023-04-07 14:31:12 +01:00
Issy Long
d636d2de37
Apply suggestions from review comments
- Rename `strictish` to `strict_only` in `add_error` method.
- Return just `errors`, a Set, not `{ errors: errors }`, a Hash,
  from `Auditor.audit`.
2023-04-06 00:10:28 +01:00
Issy Long
53a17b921f
Make --display-failures-only help hidden as it's deprecated
Co-authored-by: Mike McQuaid <mike@mikemcquaid.com>
2023-04-04 17:17:19 +01:00
Issy Long
a4e8f9e22b
audit: Make --display-failures-only the default for Casks
- Cask warnings are really noisy and numerous. Let's only show them if
  the user passes `--strict` or something implying `--strict`, like
  `--new-cask`.
- Additionally remove `display_passes` since we would like silence if
  nothing is wrong with the cask, the same as with formula audits.
2023-04-01 01:56:45 +01:00
Markus Reiter
bdd6523ce8
Deprecate appcast. 2023-03-30 03:29:06 +02:00
Dustin Rodrigues
b776fb32de
change includecount to include_count for readability 2023-03-20 07:23:17 -04:00
Dustin Rodrigues
e5fba88035
use includecount argument in pluralize 2023-03-19 23:35:47 -04:00
Douglas Eichelberger
f4c9a96c70 Enable types in dev-cmd 2023-03-14 08:32:03 -07:00
Douglas Eichelberger
f9f73f3ef6 Tidy up 2023-02-27 21:42:47 -08:00
Douglas Eichelberger
1ab278f74c Fix style/type violations 2023-02-27 20:34:07 -08:00
Douglas Eichelberger
0eccc0e987 git grep -l Utils::Inflection | xargs gsed -i 's|Utils::Inflection|Utils|g' 2023-02-27 20:18:27 -08:00
Douglas Eichelberger
3da68651e5 Port more call sites 2023-02-27 20:18:08 -08:00
Bo Anderson
e86a8c2477
Move HOMEBREW_NO_INSTALL_FROM_API defaults to shell 2023-02-24 21:53:08 +00:00
Bo Anderson
559bec95bc
Scope HOMEBREW_NO_INSTALL_FROM_API to core formulae in brew audit 2023-02-24 13:33:46 +00:00
EricFromCanada
dfc9906184
internal messaging fixes 2023-02-10 23:17:16 -05:00
Mike McQuaid
cb1872e5bf
Merge pull request #14553 from MikeMcQuaid/4.0.0-changes 2023-02-08 11:05:08 +00:00
Mike McQuaid
342d40e88d
Merge pull request #14510 from reitermarkus/audit-only-except
Pass `only` and `except` to cask audits.
2023-02-08 09:05:00 +01:00
Markus Reiter
b821a00bc5
Pass only and except to cask audits. 2023-02-08 08:38:32 +01:00
Mike McQuaid
6b4363092d
Revert "Merge pull request #14548 from Homebrew/revert-14382-deprecate-disable-remove"
This reverts commit 932d2cf3b77c9439a57b6a43577fc8d3b6399a62, reversing
changes made to f4e60482791d2ff628efadfdbf0d14d9237d2d29.
2023-02-07 19:25:51 +01:00
Mike McQuaid
6882ac17e7
Revert "Add deprecations and disables" 2023-02-07 15:13:19 +01:00
Mike McQuaid
59c03cb2a6
Add deprecations and disables
Do the usual dance:
- commented `odeprecated` to `odeprecated`
- `odeprecated` to `odisabled`
- `odisabled` removed
2023-02-03 10:48:43 +00:00
apainintheneck
2cbe89102e Comment out path args deprecation 2022-12-27 14:09:31 -08:00
apainintheneck
c2e8bf3e83 Deprecate path args to audit cmd
`brew audit` doesn't work as expected when users
pass in formula/cask paths so we are deprecating it.
2022-12-22 10:00:42 -08:00