36540 Commits

Author SHA1 Message Date
Issy Long
0af5825dfb
rubocops/cask: on_#{os_version} is after [version & sha256] group
- This still doesn't pass `brew readall` for Casks, but it gets us a
  little closer since if `url` has a `version` interpolated in it, the
  `version` stanza has to come first.
- See https://github.com/Homebrew/homebrew-cask/pull/143201 for the
  current failures.
2023-03-25 16:02:30 +00:00
Douglas Eichelberger
7720485f40 Enable types in Formula files 2023-03-25 08:50:06 -07:00
Issy Long
48b1279b00
cask/audits: on_#{os_version} stanza order is oldest => newest
- This, ie Mojave first, is more common in real Casks than the
  alternative of newest to oldest ie Ventura first.
- Doing it this way reduces the number of offenses from ~500 to ~200.
2023-03-25 14:52:30 +00:00
Issy Long
d97ed0a7c2
rubocops/cask: Ensure ordering of all the on_#{arch,system} blocks
- Complaining about only `on_arm` and `on_intel` was too restrictive
  since casks can have many `on_system` blocks (`on_#{arch}` and
  `on_#{os}`).
- We're a bit of the way there, anyway. Still doesn't support stanza
  ordering within blocks, but that's for another time (there's a
  separate issue that's been open for a while - 14017).
2023-03-25 14:52:29 +00:00
Issy Long
b484a29006
rubocops/cask: arch stanzas come before & are separate to on_#{arch}
- https://github.com/Homebrew/brew/pull/14976#issuecomment-1469002998.
- This drops the number of offenses currently in the Cask repo down from
  111 to 46.
2023-03-25 14:52:28 +00:00
Issy Long
b6062acdbe
rubocops/cask: Enforce the order of on_#{arch} blocks
- These were previously being manually fixed which is time maintainers
  could have spent fixing more important problems.
- I don't work with Casks much at all, so I was unsure as to what the
  existing "arch" and "on_arch_conditional" parts were, if they're
  deprecated or if things were eventually going to migrate to
  `on_#{arch}` blocks?
2023-03-25 14:52:24 +00:00
Issy Long
d43ba7c306
Merge pull request #15013 from issyl0/rubocops-cask-no-overrides 2023-03-25 13:44:19 +00:00
Markus Reiter
5e52d415a9
Allow fetching for different arch. 2023-03-25 11:56:09 +01:00
apainintheneck
7c5e98602f CI: split up audits into two jobs
There will be one for casks which runs on MacOS
and the other for formulae which runs on Linux.
2023-03-25 01:49:38 -07:00
apainintheneck
91c07232d4 CI: create tap audit job
This will reduce the time it takes for the tap-syntax job
to complete (currently that is the slowest one) and will
allow us to audit casks as well as formulae (casks weren't
getting audited before in CI).
2023-03-24 22:04:13 -07:00
Nanda H Krishna
c271a9ae75
Merge pull request #15054 from Homebrew/dependabot/bundler/Library/Homebrew/rspec-sorbet-1.9.2
build(deps): bump rspec-sorbet from 1.9.1 to 1.9.2 in /Library/Homebrew
2023-03-24 15:35:23 -04:00
Nanda H Krishna
4ee55f790b
Merge pull request #15055 from Homebrew/dependabot/bundler/Library/Homebrew/connection_pool-2.4.0
build(deps): bump connection_pool from 2.3.0 to 2.4.0 in /Library/Homebrew
2023-03-24 15:33:58 -04:00
BrewTestBot
70b55ffbb5
Update RBI files for connection_pool.
Autogenerated by the [vendor-gems](https://github.com/Homebrew/brew/blob/HEAD/.github/workflows/vendor-gems.yml) workflow.
2023-03-24 19:18:25 +00:00
BrewTestBot
5bd839c132
Update RBI files for rspec-sorbet.
Autogenerated by the [vendor-gems](https://github.com/Homebrew/brew/blob/HEAD/.github/workflows/vendor-gems.yml) workflow.
2023-03-24 19:16:45 +00:00
BrewTestBot
0c583a0b7d
brew vendor-gems: commit updates. 2023-03-24 19:12:37 +00:00
BrewTestBot
95bd2c002b
brew vendor-gems: commit updates. 2023-03-24 19:11:17 +00:00
dependabot[bot]
1ed5f828e4
build(deps): bump connection_pool in /Library/Homebrew
Bumps [connection_pool](https://github.com/mperham/connection_pool) from 2.3.0 to 2.4.0.
- [Release notes](https://github.com/mperham/connection_pool/releases)
- [Changelog](https://github.com/mperham/connection_pool/blob/main/Changes.md)
- [Commits](https://github.com/mperham/connection_pool/compare/v2.3.0...v2.4.0)

---
updated-dependencies:
- dependency-name: connection_pool
  dependency-type: indirect
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-03-24 19:08:48 +00:00
dependabot[bot]
f5909de3bd
build(deps): bump rspec-sorbet from 1.9.1 to 1.9.2 in /Library/Homebrew
Bumps [rspec-sorbet](https://github.com/samuelgiles/rspec-sorbet) from 1.9.1 to 1.9.2.
- [Release notes](https://github.com/samuelgiles/rspec-sorbet/releases)
- [Changelog](https://github.com/samuelgiles/rspec-sorbet/blob/master/CHANGELOG.md)
- [Commits](https://github.com/samuelgiles/rspec-sorbet/commits/v1.9.2)

---
updated-dependencies:
- dependency-name: rspec-sorbet
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-03-24 19:07:41 +00:00
Mike McQuaid
d80f7ac48e
Merge pull request #15052 from MikeMcQuaid/formulary_service
formulary: require service.
2023-03-24 10:42:17 +00:00
Mike McQuaid
a0eb5ebec7
formulary: require service.
This is used in this file.
2023-03-24 09:23:09 +00:00
Mike McQuaid
9a491a2bd3
Merge pull request #15050 from Homebrew/no_more_ubuntu_16
docker: stop building Ubuntu 16.04 image.
2023-03-24 09:13:17 +00:00
Mike McQuaid
6a77ef2170
docker: stop building Ubuntu 16.04 image.
This is too slow to be building every time and we're long past the
deprecation date.

Fixes https://github.com/Homebrew/brew/issues/14661
2023-03-24 08:57:48 +00:00
Mike McQuaid
fad8deda56
Merge pull request #15046 from issyl0/rubocop-method-parameter-pr
rubocop: Remove the final `Naming/MethodParameterName` exceptions: `pr`
2023-03-24 08:51:49 +00:00
Mike McQuaid
7b4de4ad1f
Merge pull request #15035 from hartwork/dockerfile-fix-build
Dockerfile: Fix the build, package gh exists in Ubuntu >=22 only
2023-03-24 08:44:31 +00:00
Sebastian Pipping
bd16355a07 docker.yml: Run for pull requests also, for debuggability 2023-03-24 05:43:04 +01:00
Sebastian Pipping
05319c86dc Dockerfile: Install gpg (GnuPG 2.x) for Ubuntu 18 and 20 also 2023-03-24 05:42:33 +01:00
Kevin
86c518e2d7
Merge pull request #15007 from apainintheneck/add-service-block-to-formula-api
Add service block to formula api
2023-03-23 17:30:04 -07:00
Issy Long
61dc026fcc
rubocop: Remove the final Naming/MethodParameterName exceptions: pr
- Core RuboCop didn't want this shortening upstreamed, but that's OK!
2023-03-24 00:29:42 +00:00
Sebastian Pipping
51f171e506 Dockerfile: Fix the build, package gh exists in Ubuntu >=22 only 2023-03-23 20:38:08 +01:00
Issy Long
e4156909d4
Only take overrideable stanzas into account
- This skips over stanza names that are not overrideable in `on_*`
  blocks, with the positive side effect that `on_*` blocks themselves
  aren't in the list so we can get rid of another conditional.
- Stanzas overrideable in blocks are defined in `Cask::DSL` by each of
  the methods calling `set_unique_stanza`.
2023-03-23 18:59:29 +00:00
Mike McQuaid
78feddce94
Merge pull request #15044 from Homebrew/revert-15040-move_cask/cmd/reinstall
Revert "move `cask/cmd/reinstall`"
2023-03-23 17:26:21 +00:00
Mike McQuaid
253dca568c
Revert "move cask/cmd/reinstall" 2023-03-23 17:06:42 +00:00
Mike McQuaid
8f9caa3427
Merge pull request #15040 from hyuraku/move_cask/cmd/reinstall
move `cask/cmd/reinstall`
2023-03-23 16:31:01 +00:00
hyuraku
6a5ed3497e repair the options 2023-03-24 00:42:10 +09:00
Mike McQuaid
c31da2b3c9
Merge pull request #15042 from MikeMcQuaid/skip_post_install
Add `brew install --skip-post-install`
2023-03-23 15:37:06 +00:00
Mike McQuaid
95a8c3f638
Add brew install --skip-post-install
Will be needed by `brew test-bot`.
2023-03-23 15:22:27 +00:00
hyuraku
ca3520e379 repair Cask#Reinstall::reinstall_casks 2023-03-23 23:39:58 +09:00
Issy Long
d4d413db62
String interpolations in regexps should also be allowed
- This came up in Cask `simply-fortran`:

```
Scanning /opt/homebrew/Library/Taps/homebrew/homebrew-cask/Casks/simply-fortran.rb
send_node: s(:send, nil, :arch), send_node.parent: s(:begin,
  s(:send, nil, :arch)), send_node.parent.parent: (regexp
  (str "href=.*?simplyfortran[._-]v?(\\d+(?:\\.\\d+)+)")
  (begin
    (send nil :arch))
  (str "\\.dmg")
  (regopt :i))
Casks/simply-fortran.rb:2:3: C: Cask/NoOverrides: Do not use a top-level arch stanza as the default. Add it to an on_{system} block instead.
Use :or_older or :or_newer to specify a range of macOS versions.

  arch arm: "-arm64", intel: "-x86_64"
  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

1 file inspected, 1 offense detected
```
2023-03-23 13:55:00 +00:00
hyuraku
75c867e296 move cask/cmd/reinstall_spec to cask/reinstall_spec 2023-03-23 22:50:28 +09:00
hyuraku
31e49d96af move cask/cmd/reinstall to cask/reinstall 2023-03-23 22:50:03 +09:00
Issy Long
c1de3dfb90
Fix string interpolation detection again to be even broader
- My approach wasn't quite good enough. Replace it with what RuboCop
  itself does to detect all forms of string interpolation.
2023-03-23 13:17:09 +00:00
Mike McQuaid
ea92f56da4
Merge pull request #15039 from Homebrew/improve-ci-jobs
Improve some CI jobs
2023-03-23 10:03:37 +00:00
Mike McQuaid
7a22d919ad
Merge pull request #15038 from MikeMcQuaid/update-report-fix-ordering
cmd/update-report: fix ordering.
2023-03-23 09:46:56 +00:00
Mike McQuaid
510c4dce76
Improve some CI jobs
- make the CodeCov CI job informational. We don't want red PRs just
  because the coverage varies slightly. We still get comments inline
  saying where code coverage is met; this is more useful during review
  than a single number and failing status
- make the Triage CI job do less: instead of enforcing a time period for
  review window, make it only exist to self-approve PRs for merge and
  require a maintainer otherwise to review
2023-03-23 09:20:09 +00:00
Mike McQuaid
e75b983686
cmd/update-report: fix ordering.
New formulae/casks were shown as removed and vice versa.

Fixes #15036
2023-03-23 08:48:48 +00:00
apainintheneck
6ccf21c2c9 Merge branch 'master' into add-service-block-to-formula-api 2023-03-22 20:06:32 -07:00
apainintheneck
801ee5e474 Address feedback
- style nits
- better comments for tests that are not idempotent
- moved appdir placeholder constant to global.rb
2023-03-22 19:43:49 -07:00
Issy Long
0889593e2a
Another failing test for a real Cask, version.csv.first interpolated 2023-03-23 00:02:17 +00:00
Issy Long
e66226aefc
Fix skipping of livecheck block contents in on_* blocks
- This passes the previously failing test for `on_*` blocks with
  `livecheck` blocks with multiple stanzas inside them (eg `url` and
  `strategy`) that weren't being correctly skipped because we weren't
  detecting high enough up the ancestry.
2023-03-22 23:17:32 +00:00
Issy Long
991e5f2f9c
Failing test for mishandling contents of livecheck blocks in on_*
- The Cask `little-snitch4` in `Homebrew/homebrew-cask-versions` was
  failing and it took me a while to figure out _how_. Add a test for
  easier further debugging (and to prevent breakage once the bug is
  fixed).

```
❯ brew tests --only=rubocops/cask/no_overrides
Randomized with seed 29917
1 process for 1 spec, ~ 1 spec per process
F

Failures:

  1) RuboCop::Cop::Cask::NoOverrides when there are livecheck blocks within `on_*` blocks, ignore their contents does not report any offenses
     Failure/Error: DEFAULT_FAILURE_NOTIFIER = lambda { |failure, _opts| raise failure }
       expected `[#<RuboCop::Cop::Offense:0x000000012de636c8 @severity=#<RuboCop::Cop::Severity:0x000000012de636a0 @name=:convention>, @location=#<Parser::Source::Range (string) 244...273>, @message="Do not use a top-level `url` stanza as the default. Add it to an `on_{system}` block instead.\nUse `:or_older` or `:or_newer` to specify a range of macOS versions.\n", @cop_name="Cask/NoOverrides", @status=:unsupported, @corrector=nil>].empty?` to be truthy, got false
     Shared Example Group: "does not report any offenses" called from ./test/rubocops/cask/no_overrides_spec.rb:77
     # ./test/rubocops/cask/shared_examples/cask_cop.rb:24:in `expect_no_offenses'
     # ./test/rubocops/cask/shared_examples/cask_cop.rb:7:in `block (2 levels) in <module:CaskCop>'

Took 2 seconds
Tests Failed
```
2023-03-22 21:41:28 +00:00