5014 Commits

Author SHA1 Message Date
Issy Long
a2b488cd10
Merge pull request #14818 from issyl0/rubocop-documentation
rubocop: Only enable `Style/Documentation` for `@api public` code
2023-02-28 13:47:13 +00:00
Mike McQuaid
eeadcc8ded
Merge pull request #14632 from bevanjkay/cask-sample-languages-audit
cask/auditor: only audit 10 languages by default on casks with many languages
2023-02-28 12:16:51 +00:00
Mike McQuaid
d0e03fc425
Merge pull request #14820 from apainintheneck/delay-loading-from-cask-source-api
Delay loading from cask source api
2023-02-28 11:50:10 +00:00
Bevan Kay
48a7282458
fix style 2023-02-28 19:02:08 +11:00
Bevan Kay
295a3539a5
Update with-many-languages.rb 2023-02-28 18:55:12 +11:00
Bevan Kay
d1b09a90da
cask/auditor: only audit 10 languages by default on casks with many languages 2023-02-28 18:54:27 +11:00
Douglas Eichelberger
6ea501b59f Add tests 2023-02-27 20:30:55 -08:00
Issy Long
316df75da9
utils: Add a comment to module Kernel to appease RuboCop
- This `Homebrew/utils.rb` file contains one `@api public` method so it's now
  included in `Style/Documentation`.
- This method not having a comment was causing the style specs to fail because
  this file isn't usually failing RuboCop.
- And the test description was confusing so I improved it.
2023-02-28 00:18:52 +00:00
Douglas Eichelberger
1a0c02ffe0 Move tests too 2023-02-27 11:22:23 -08:00
apainintheneck
fdc2e9f3f5 Merge branch 'master' into delay-loading-from-cask-source-api 2023-02-26 14:50:13 -08:00
apainintheneck
9af04fdf38 Add installer tests 2023-02-26 11:26:44 -08:00
apainintheneck
fd62cdf636 cask: delay loading from source API
For casks with certain stanzas, *flight and language
stanzas in this case, we need to use the caskfile
to install them correctly. The JSON API is not an option.

This delays loading from the source API until just before
we try to install one of these casks. This reduces the
number of requests we make to the source API.
2023-02-25 20:54:37 -08:00
Issy Long
1edb59e086
test/search: Fix stubbing of GitHub::API.open_rest call
Test failure:

```
Failure/Error:
  expect(described_class.search_taps("some-formula"))
    .to match(formulae: ["homebrew/foo/some-formula"], casks: ["homebrew/bar/some-cask"])

  GitHub::API asked to yield |[{"items"=>[{"path"=>"Formula/some-formula.rb", "repository"=>{"full_name"=>"Homebrew/homebrew-foo"}}, {"path"=>"Casks/some-cask.rb", "repository"=>{"full_name"=>"Homebrew/homebrew-bar"}}]}]| but no block was passed
```
2023-02-25 22:00:37 +00:00
Bo Anderson
e86a8c2477
Move HOMEBREW_NO_INSTALL_FROM_API defaults to shell 2023-02-24 21:53:08 +00:00
Mike McQuaid
9fd50a9ab0
Merge pull request #14785 from samford/livecheck/add-json-strategy
livecheck: Add `Json` strategy
2023-02-24 18:02:40 +00:00
Mike McQuaid
a72573a6bc
Merge pull request #14507 from maxim-belkin/cache-doctor-checks
Bash completions: cache names of 'doctor' checks
2023-02-24 15:47:17 +00:00
Maxim Belkin
5382774848 Update Bash completion tests 2023-02-24 15:23:13 +00:00
Bo Anderson
aebc125e9c
cask: support url specs in API 2023-02-24 13:56:46 +00:00
Mike McQuaid
041545db2c
Merge pull request #14735 from reitermarkus/revert-14729-revert-14711-extract-permissions
Revert "Revert "Fix permissions before moving extracted files.""
2023-02-24 12:59:59 +00:00
Markus Reiter
7a2aa85225
Only make directories writable when extracting. 2023-02-24 12:28:05 +01:00
Markus Reiter
ebfc3996fd
Allow “which” as context prefix. 2023-02-24 12:28:05 +01:00
Markus Reiter
fa2d917dec
Add test for extracting unwritable files. 2023-02-24 12:28:05 +01:00
Mike McQuaid
f280ce069b
Support loading formulae/casks from subdirectories
Previously, we required all formulae and casks to be in a specific
formula or cask directory but did not check any subdirectories.

This commit allows using subdirectories for official taps, the only
ones likely to be big enough to warrant sharding in this way and to
avoid potentially breaking backwards compatibility for existing taps.

This was inspired by the most recent issues with homebrew-cask.
2023-02-24 10:57:41 +00:00
DenizUgur
46aefe776f fix tests 2023-02-23 11:08:39 -08:00
DenizUgur
026709962d update tests 2023-02-23 11:02:20 -08:00
Sam Ford
7735036c56
livecheck: Add Json strategy
This adds a generic `Json` strategy to livecheck that requires a
`strategy` block to operate. This is primarily intended as a
replacement for existing `strategy` blocks in formulae/casks that
use `JSON#parse`, as it allows us to internalize/standardize that
boilerplate while improving error-handling.

Additionally, future strategies that parse JSON data can use the
`Json#find_versions` method instead of having to reinvent the wheel
(similar to how we currently have a number of strategies that
leverage `PageMatch#find_versions`).
2023-02-23 13:17:35 -05:00
Mike McQuaid
d7029e95cd
Merge pull request #14769 from dduugg/enable-types
Enable typing in Cask::Artifact
2023-02-23 18:02:44 +00:00
Mike McQuaid
f6d1fa62f1
Merge pull request #14762 from MikeMcQuaid/generate_api
Add generate-{cask,formula}-api commands
2023-02-23 09:02:15 +00:00
Bo Anderson
e663f532a6
Checksum Ruby source file downloads 2023-02-22 22:50:24 +00:00
Bo Anderson
b7d6d00c34
api: use signed endpoint 2023-02-22 21:53:32 +00:00
Douglas Eichelberger
29c6baeed1 Enable typing in Cask::Artifact 2023-02-22 09:11:29 -08:00
Mike McQuaid
8d02143c2b
Add generate-{cask,formula}-api commands
These replace the similar scripts in formulae.brew.sh.

Part of #14730.
2023-02-22 15:33:16 +00:00
Mike McQuaid
7ac31f7d65
Merge pull request #14732 from dduugg/formula-cop-mixin
Refactor FormulaCop as an abstract class
2023-02-21 23:05:58 +00:00
Douglas Eichelberger
d9db5e8825 Refactor FormulaCop as a mixin 2023-02-20 18:14:47 -08:00
Issy Long
298bb65dfb
rubocop: Entirely disable Metrics cops
- These are arbitrary length limits that had a load of disables in code.
- The limits were only increasing over time rather than decreasing.
- Fixing the problematic code to be shorter would take a long time for
  questionable gain since the problem has been around so long.
2023-02-21 00:34:17 +00:00
Bo Anderson
cacd7194f6
Support link_overwrite and conflicts_with in API 2023-02-20 16:28:07 +00:00
Mike McQuaid
aaec4014fd
Merge pull request #14710 from issyl0/rubocop-excludes
rubocop: Clean up some `Exclude`s
2023-02-20 09:51:11 +00:00
Issy Long
f8654bd363
rubocop: In-line disables of Metrics/{Module,Block,Class}Length
- We're not going to make the really long things be any shorter any time soon.
- The instructions in issue 14685 say, pragmatically, "disable all the rubocop
  rules we're never going to realistically fix e.g. Metrics/ClassLength". But
  that felt like a slippery slope to more _really_ long modules/classes/blocks,
  and the limits are here for a reason.
2023-02-19 16:33:23 +00:00
Issy Long
4a8384e8a8
rubocop: In-line disables of Lint/ConstantDefinitionInBlock 2023-02-19 16:33:22 +00:00
Bo Anderson
c2342eca91
Further improvements to API handling in shell 2023-02-19 05:38:13 +00:00
Mike McQuaid
a743e9277f
workflows/tests: faster, more reliable tests.
- Extract update tests into separate tests.
- Make `brew tests --online` run only once in its own job. This job
  could be made non-required to fight flakiness.
- Split up the various macOS runs into several steps now that we have
  more parallel macOS workers available.
- Cleanup some flaky tests.
2023-02-17 15:26:18 +00:00
Mike McQuaid
897121de88
Merge pull request #14678 from apainintheneck/add-cask-api-loader-tests
cask: add FromAPILoader tests
2023-02-17 12:34:22 +00:00
apainintheneck
3eede57ba2 ::FromAPILoader tests for cask 2023-02-16 19:35:34 -08:00
Bo Anderson
921b427ff2
test/utils/analytics_spec: fix flaky test 2023-02-17 02:17:03 +00:00
Mike McQuaid
17c872fb52
Merge pull request #14657 from MikeMcQuaid/tap_cask_api
tap: return the default_remote if not installed.
2023-02-16 12:52:25 +00:00
Mike McQuaid
53c57d7a70
tap: return the default_remote if not installed.
Fixes #14656.
2023-02-16 12:25:28 +00:00
Mike McQuaid
f7f04bae26
api: use formulae.brew.sh for cask-source API again.
GitHub's raw endpoint is proving hilariously unreliable for us here.
2023-02-16 12:05:38 +00:00
Mike McQuaid
769a8c5001
analytics: report to InfluxDB by default.
Now that this is ready: let's roll it out to everyone in 4.0.0.
2023-02-15 17:27:02 +00:00
Mike McQuaid
c5252817c2
analytics: refactor InfluxDB/Google handling. 2023-02-15 16:34:50 +00:00
Sean Molenaar
50e9247da4
fix: add better keys and fuller values to influxDB analytics 2023-02-15 14:12:05 +01:00