5014 Commits

Author SHA1 Message Date
Issy Long
b82c5f1d36
Fix detection of string interpolation
- This was almost there but not quite and the lack of tests lulled me into a false sense of security.
2023-03-22 19:13:47 +00:00
apainintheneck
e83a2562bb Update service and formulary specs 2023-03-22 00:01:58 -07:00
apainintheneck
38146893c3 api_hashable: Make API path subs generic
This turns the ability to replace common paths with placeholders
into a mixin that can be used with both Casks and Formulae.

The idea here is to make formula hash generation more consistent.
2023-03-21 23:20:42 -07:00
Issy Long
bc796a3120
Add a failing test for the arch inside url inside on_* weirdness
- So that I remember what's up with this after some sleep.
2023-03-22 00:23:38 +00:00
Issy Long
8091e603df
rubocops/cask: Ignore livecheck blocks within on_* blocks
- The Cask `sip`, to give a random example, was failing this RuboCop
  because it has a `livecheck` block within an `on_*` block and the
  livecheck block and the top-level Cask both have `url` stanzas. This
  is a legitimate use of `livecheck` blocks because the cask software
  download URL and the livecheck version check URL are not the same
  thing, so let's skip over `livecheck` blocks and their contents.
2023-03-21 23:49:54 +00:00
Issy Long
ebdd408f99
test/fixtures: Put the on_system blocks in oldest => newest order 2023-03-21 22:51:23 +00:00
Issy Long
478ba9b604
rubocops/cask: Add another test case to check I've done it right?
- I wrote this because I was concerned that I'd done something wrong
  since `brew style --only=Cask/NoOverrides` in
  `$(brew --repo homebrew/cask)` didn't report any offenses. Turns out
  I'd just missed the `.` off the end of the command to target the
  current directory! But, the cost of writing the test is sunk now,
  and more tests can't hurt?
2023-03-21 22:51:22 +00:00
Issy Long
1e18e88c68
test/fixtures: Fix style for the new Cask/NoOverrides cop 2023-03-21 22:51:21 +00:00
Issy Long
35cd764261
rubocops/cask: Tweak offense message to read better 2023-03-21 22:51:20 +00:00
Issy Long
ff2fad6bcf
rubocops/cask: Don't force on_* blocks for all stanzas
- In the event that there's only one common stanza within the `on_*`
  blocks (eg, `url`) with a generic `version` that doesn't change per-OS,
  let's not force adding `version` to each `on_*` block as well.
2023-03-21 22:51:18 +00:00
Issy Long
dec1309140
rubocops/cask: Casks with zero on_* blocks are still valid 2023-03-21 22:51:17 +00:00
Issy Long
9cc046bc60
rubocops/cask: Enforce the use of on_{system} blocks
- As discussed in
  https://github.com/Homebrew/brew/pull/14976#issuecomment-1474544569
  and further comments, this is needed because in order to enforce the
  order of `on_{arch,system}` blocks we need to have everything
  consistently within one of those blocks.
- We previously allowed overrides where the top-level `version` stanza
  would be the default, unless on an OS that had an `on_system` block
  with a `version` specified. But this breaks down when we try to order
  the `on_system` blocks because if a `url` at the top-level has a
  `version` interpolated in it, then the `version` stanza needs to be
  above the `url` stanza. But it could be that `version` is OS-specific.
- Let's stop allowing overrides and require that everything be in an
  `on_system` block. This will make it easier to enforce the order of
  `on_system` blocks in a future PR (14976).
2023-03-21 22:51:12 +00:00
Mike McQuaid
8bf8393b89
Merge pull request #15021 from MikeMcQuaid/influxdb_cardinality
analytics: improve InfluxDB cardinality
2023-03-20 15:54:17 +00:00
Mike McQuaid
4d8445e29d
analytics: improve InfluxDB cardinality
- roll InfluxDB token (we need to report to a new bucket to fix implicit schema)
- adjust various parameters
- separate default tags and fields
- send more fields and fewer tags (tags should have low cardinality)
- use `--data-binary` to match InfluxDB documentation
- document second precision for greater InfluxDB performance
- pass through tap name, formula/cask name, options separately
- pass `devcmdrun` as a tag
- avoid sending very high-cardinality `OS_VERSION` values
2023-03-20 15:26:47 +00:00
Dustin Rodrigues
b776fb32de
change includecount to include_count for readability 2023-03-20 07:23:17 -04:00
Dustin Rodrigues
b68c955946
utils: add includecount argument to pluralize util 2023-03-19 23:35:40 -04:00
Mike McQuaid
c31ae1ce6a
Merge pull request #14948 from hyuraku/remove-cask/cmd/fetch
remove `cask/cmd/fetch`
2023-03-19 17:21:22 -04:00
Issy Long
b979646c42
Merge pull request #15000 from issyl0/fix-extra-blank-line-in-caveats
caveats: Remove extra blank line between `keg_only` and other caveats
2023-03-19 20:57:15 +00:00
Issy Long
f10b88ca85
caveats: Add a new line if there isn't one from previous conditions 2023-03-19 18:38:09 +00:00
hyuraku
4271d41e51 remove new specs 2023-03-19 22:31:00 +09:00
hyuraku
dfee012f77 change cask spec to formula one 2023-03-19 19:14:46 +09:00
apainintheneck
d42e9b40d5 formulary: add test for loading service blocks from API 2023-03-19 00:09:16 -07:00
apainintheneck
501730df5d Add service serialization specs 2023-03-19 00:09:16 -07:00
Issy Long
865e99c611
test/cask: Rename 'expected_json_ventura' since it's >= Ventura
- Let's actually show in the fixtures JSON filename what's changed
  between the two.
2023-03-18 15:16:23 +00:00
Issy Long
6b4b923b44
test/cask: Fix "System Settings" caveats for (non-)Ventura OSes
- "System Preferences" was updated to be "System Settings" in macOS
  Ventura. This naming was updated in our caveats generator in PR 14997.
- This test was failing for me locally (on Ventura) because it was
  hardcoded to expect `System Preferences => Security & Privacy`, but
  getting `System Settings => Privacy & Security`.
- This is not the most important thing in the world, we can probably
  live with the failing test, but I thought I'd try to fix it anyway.
2023-03-18 13:19:20 +00:00
Mike McQuaid
647d86f3e4
Merge pull request #14998 from stevenlele/locale
Fix locale parsing
2023-03-17 15:36:22 -04:00
Mike McQuaid
b8743d337b
Merge pull request #14991 from issyl0/cask-url-audit-pass-referrer
cask/audit: Pass a URL's `referer` through to cURL
2023-03-17 15:33:38 -04:00
stevenlele
c9e44a0395 Update test 2023-03-17 20:35:17 +08:00
stevenlele
ca22b67dd2 Fix locale parsing 2023-03-17 20:15:42 +08: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
Mike McQuaid
6fd54eba5f
Merge pull request #14985 from dduugg/no-compat
Remove compatibility layer
2023-03-15 13:48:00 -04:00
Mike McQuaid
83aea49d8a
Merge pull request #14981 from dduugg/tab-no-ostruct
Remove OpenStruct use in Tab
2023-03-15 12:16:49 -04:00
Markus Reiter
9d415e22da
Simplify SPDX test. 2023-03-15 14:30:47 +01:00
Douglas Eichelberger
4d32699f61 Placate rubocop 2023-03-14 23:01:09 -07:00
Douglas Eichelberger
cc5b013cb9 Remove compatibility layer 2023-03-14 14:49:34 -07:00
Douglas Eichelberger
6238a0779d remove test 2023-03-14 11:46:38 -07:00
Douglas Eichelberger
a1748605ab Minor Kernel cleanup 2023-03-14 10:27:16 -07:00
Douglas Eichelberger
c178986235 Fix tests 2023-03-14 08:50:56 -07:00
hyuraku
7d90e3a2a1 add new spec to cmd/fetch_spec 2023-03-13 22:31:09 +09:00
Mike McQuaid
296c5088aa
Merge pull request #14935 from hyuraku/move-cask/cmd/uninstall
Move cask/cmd/uninstall
2023-03-13 10:19:41 +00:00
hyuraku
da6f48dbd0
Merge branch 'master' into move-cask/cmd/uninstall 2023-03-12 11:49:06 +09:00
Douglas Eichelberger
731a02ee73 rm .brew_irb_history 2023-03-11 17:27:53 -08:00
Douglas Eichelberger
826aca7217 Add tests 2023-03-11 17:27:53 -08:00
Douglas Eichelberger
8a57c37c33 Fix extend/array_spec 2023-03-11 17:27:53 -08:00
Douglas Eichelberger
999594dc07 Remove oxford comma from to_sentence default 2023-03-11 17:27:53 -08:00
Issy Long
8e13a6e1f4
Merge pull request #14944 from issyl0/more-rubocop-naming-method-parameter-name
rubocop: Further trim `Naming/MethodParameterName` allowlist
2023-03-11 22:59:39 +00:00
hyuraku
08560e04ae remove cask/cmd/fetch_spec 2023-03-11 22:13:00 +09:00
hyuraku
e321edabbc remove options and comments 2023-03-11 21:15:24 +09:00
Issy Long
e9d994622e
rubocop: Drop "f" from Naming/MethodParameterName allowlist
- This either stands for "file" but more often than not "formula".
2023-03-11 00:17:27 +00:00
apainintheneck
2baaafba92 Cleanup irb history file in tests
This was caused by the irb spec. Note that
$HOME is set during the test setup so will
always be correct.
2023-03-09 17:07:08 -08:00