187 Commits

Author SHA1 Message Date
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
Ruoyu Zhong
05ffff09ed
cask/audit: fix Utils::Curl usage
Needed after #15940.
2023-09-06 00:12:57 +08:00
Mike McQuaid
1a91157590
Fix more missing Utils::Curl references.
e.g. https://github.com/Homebrew/brew/pull/15940#issuecomment-1706486816
2023-09-05 08:27:02 -04:00
Eric Knibbe
686638b683
cask/audit: format-check block URLs only if online 2023-08-29 17:10:40 -04:00
Razvan Azamfirei
72df964b33
change path 2023-08-09 15:27:36 -04:00
Razvan Azamfirei
a916d6184b
Update Library/Homebrew/cask/audit.rb
Co-authored-by: Mike McQuaid <mike@mikemcquaid.com>
2023-08-09 15:26:47 -04:00
Razvan Azamfirei
ef9e0bc8a6
cask/audit: audit for appropriate sharding directory 2023-08-09 14:52:30 -04:00
Mike McQuaid
b3c33d34ab
Various sharding fixes
- Load paths with no API when needed (e.g. for `brew edit`)
- Use no API mode for `brew log` as it's needed there
- Define sharding format for homebrew-cask and homebrew-core inside
  `Tap` methods
- Create new formulae/casks in location defined by these `Tap` methods
- Fix a bug in Formulary that made sharded formulae lookup less
  efficient (and possibly broke it for core and some API usage)
- Fix various other hardcoded Formula/Cask directory assumptions

Co-authored-by: Bo Anderson <mail@boanderson.me>
2023-08-04 16:43:13 +01: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
Markus Reiter
813e639678
Add cask URL location to audit problems. 2023-05-21 16:17:16 +02:00
Markus Reiter
7cc1b6191e
Clean up brew audit output. 2023-05-19 19:40:37 +02:00
Markus Reiter
8274920217
Rename OS::Mac::Version to MacOSVersion. 2023-05-09 05:08:38 +02:00
Douglas Eichelberger
08af78a2a5 brew style --fix 2023-04-25 09:26:24 -07:00
Douglas Eichelberger
24cf6076e8 brew style --fix 2023-04-24 20:42:39 -07:00
Vítor Galvão
4437b95397
Cask audit: check binary signature and notarisation 2023-04-18 19:26:14 +01:00
Markus Reiter
ad3d207172
Merge pull request #15219 from vitorgalvao/patch-1
audit.rb: Check for signature with sptcl
2023-04-15 12:40:28 +02:00
Vítor Galvão
654859c25f audit.rb: Check for signature with sptcl 2023-04-14 18:47:35 +01:00
Markus Reiter
95e3b43647
Fix repo audit for discontinued casks. 2023-04-14 19:02:07 +02:00
Markus Reiter
19939ac276
Fix codesign audit paths. 2023-04-12 19:57:42 +02:00
Issy Long
a1d4a46f06
Update Library/Homebrew/cask/audit.rb
Co-authored-by: Markus Reiter <me@reitermark.us>
2023-04-06 10:13:02 +01:00
Issy Long
93de196a34
Update Library/Homebrew/cask/audit.rb 2023-04-06 09:49:20 +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
df8e97fef6
Consolidate add_{warning,error} methods into one
- Specify `strictish: true` in `add_error` to specify that it's not a
  super big critical error.
- These will be shown only if `brew audit --strict` is requested.
2023-04-01 01:56:47 +01:00
Issy Long
2b8127d518
Turn cask warnings into errors when --strict is passed (or implied)
- Ignore them and don't show them otherwise.
- Part three of issue 15074:
  > As a result, I propose that all current cask audit warnings are never
  > displayed as warnings but the underlying audit checks turned into
  > errors displayed only with --strict (or one of the other relevant
  > flags).
2023-04-01 01:56:46 +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
Issy Long
0701ea42fa
cask/audit: Pass a URL's referer through to cURL
- Some casks have URL arguments like "referer" (spelled wrong, that's
  intentional in the HTTP spec).
- The audit for one such cask, `iThoughtsX`, was failing because the
  "referer" wasn't getting passed through to cURL so the access would
  404.

----

Before:

```
❯ brew audit --cask --online --appcast --signing 'ithoughtsx'
[...]
audit for ithoughtsx: failed
 - The binary URL https://cdn.toketaware.com?download=iThoughtsX.zip is not reachable (HTTP status code 404)
 - Version '9.2.0' differs from '9.3.0' retrieved by livecheck.
 - Version '9.2.0' differs from '9.3.0' retrieved by livecheck.
Error: 2 problems in 1 cask detected
```

After:

```
❯ brew audit --cask --online --appcast --signing 'ithoughtsx'
[...]
audit for ithoughtsx: failed
 - Version '9.2.0' differs from '9.3.0' retrieved by livecheck.
 - Version '9.2.0' differs from '9.3.0' retrieved by livecheck.
Error: 1 problem in 1 cask detected
```
2023-03-16 23:28:50 +00:00
Sean Molenaar
45c7e854db
cask: retry audit for correct signing of pkg installers
This reverts commit 7497f805ba92186121bd170b504e6bdf2dea1407.
2023-03-04 16:28:38 +01:00
Markus Reiter
a2a68292ae
Allow version :latest if livecheck is skip. 2023-02-28 10:35:07 +01:00
Mike McQuaid
5975ca981d
Merge pull request #14808 from dduugg/audit-types
Fixed type error in 'brew audit'
2023-02-27 13:33:05 +00:00
Douglas Eichelberger
7f4250241f Fixd type error in 'brew audit' 2023-02-24 16:20:51 -08:00
Bo Anderson
e86a8c2477
Move HOMEBREW_NO_INSTALL_FROM_API defaults to shell 2023-02-24 21:53:08 +00:00
Bevan Kay
7497f805ba
Revert "cask: audit for correct signing of pkg installers" 2023-02-23 09:12:24 +11:00
Sean Molenaar
2b1fbaa26d
Merge pull request #14748 from SMillerDev/feat/cask/audit_short_version_sparkle
cask: audit if sparkle livecheck needs multipart version
2023-02-22 20:23:17 +01:00
Sean Molenaar
c14b7917a2
Update Library/Homebrew/cask/audit.rb 2023-02-22 19:43:02 +01:00
Sean Molenaar
dcb6522604
audit: fix appcast_unneeded_long_version syntax 2023-02-22 12:02:25 +01:00
Sean Molenaar
77fc4c2f8a
audit: check if third version exists before checking URL 2023-02-22 11:58:19 +01:00
Sean Molenaar
4dcf5f0ad7
cask: audit style fixes
Co-authored-by: Mike McQuaid <mike@mikemcquaid.com>
2023-02-21 19:29:05 +01:00
Sean Molenaar
8806178cf3
cask: audit if sparkle livecheck needs multipart version 2023-02-21 19:27:07 +01:00
Sean Molenaar
c5786ea799
cask: audit for correct signing of pkg installers 2023-02-21 17:05:55 +01:00
Mike McQuaid
d292dbdc2b
Revert "Fix permissions before moving extracted files." 2023-02-20 17:20:57 +00:00
Markus Reiter
7c5b6fd10d
Add signatures for extraction methods. 2023-02-19 19:29:21 +01:00
Markus Reiter
cd18703582
Add audit for versions containing colons or slashes. 2023-02-14 02:08:56 +01:00
Markus Reiter
b821a00bc5
Pass only and except to cask audits. 2023-02-08 08:38:32 +01:00
Alexander Regueiro
b2b7072fbe Permit multiple uninstall stanzas in casks (temp)
Longer-term solution is described [here](https://github.com/Homebrew/brew/issues/14365#issuecomment-1398214354).
2023-01-21 18:45:58 +00:00
Patrick Linnane
7b6c8329b1
Update Library/Homebrew/cask/audit.rb
Co-authored-by: Rylan Polster <rslpolster@gmail.com>
2022-12-28 21:31:02 -08:00
Patrick Linnane
ed6d7ce995
cask/audit: improve handling nil in sparkle 2022-12-28 21:17:38 -08:00
Bevan Kay
c45a32ea8d
Update Library/Homebrew/cask/audit.rb
Co-authored-by: Rylan Polster <rslpolster@gmail.com>
2022-12-28 16:32:58 +11:00
Bevan Kay
2788efb732
Update audit.rb 2022-12-28 16:26:45 +11:00
Bevan Kay
3e11f315f7
cask/audit: improve sparkle minimum version audit 2022-12-28 15:18:59 +11:00