35804 Commits

Author SHA1 Message Date
Douglas Eichelberger
37015b6b08 Change to pluralize, port more call sites 2023-02-27 20:17:33 -08:00
Douglas Eichelberger
0438a3a538 Draft implementation to replace ActiveSupport inflections 2023-02-27 20:17:33 -08:00
BrewTestBot
ceae9c3485
sorbet: Update RBI files.
Autogenerated by the [sorbet](https://github.com/Homebrew/brew/blob/master/.github/workflows/sorbet.yml) workflow.
2023-02-28 00:30:18 +00:00
Issy Long
033dacac10
rubocop: Tweak Style/Documentation include paths after PR 14805
- The `Kernel` module, which needed a comment because it has an "@api public"
  method in it, moved.
2023-02-28 00:19:57 +00:00
Issy Long
93e2f86cf8
ci: Add an Action to check RuboCop filepaths
- This will stop the `Style/Documentation` filepath includes getting out of
  sync with what we declare as a public API, thus ensuring that everything is
  documented.
- Maybe we could also add a job here to check that _all_ the paths in the
  RuboCop config still exist, but that's for another time.
2023-02-28 00:18:55 +00:00
Issy Long
9ec74fea2a
rubocop: Reinstate taps ignore for Style/Documentation 2023-02-28 00:18:54 +00:00
Issy Long
27610e0a66
rubocop: Move Style/Documentation stanza
- This is better in the `Library/Homebrew/.rubocop.yml` since it's
  operating on files that are within that directory.
2023-02-28 00:18:53 +00: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
Issy Long
32e7268596
rubocop: Only enable Style/Documentation for @api public code
- Suggested in https://github.com/Homebrew/brew/pull/14709#issuecomment-1437461642.
- Found the public API paths with `git grep -l "@api public"`.
2023-02-28 00:10:06 +00:00
Mike McQuaid
6db7732fa3
Merge pull request #14821 from issyl0/support-date-ranges-in-pr-reviews-query
dev-cmd/contributions: Support date ranges in PR reviews query
2023-02-28 00:06:41 +00:00
Sam Ford
ec7fd75934
Strategy#from_url: Replace #from_symbol call
Passing the strategy symbol into the `#from_url` `select` block
means that we can also get rid of a `#from_symbol` call in a
different conditional branch, as we can directly compare the
`livecheck_strategy` symbol to `strategy_symbol`.
2023-02-27 18:58:15 -05:00
Sam Ford
03823b5698
Strategy#from_url: Amend conditions for Json
When the `Json` strategy was introduced, I forgot to also ensure
that it's only treated as usable (in `Strategy#from_url`) if a
`livecheck` block uses `strategy :json`. As a result, `Json` is
incorrectly treated as a usable strategy for all formulae/casks that
contain a `strategy` block.

Since all of these `livecheck` blocks specify a strategy, this bug
doesn't meaningfully impact livecheck's behavior (i.e., these checks
continue to use their explicitly-specified strategy). The only
practical difference is that `Json` incorrectly appears in the list
of usable strategies in livecheck's verbose JSON output.

This commit modifies `Strategy#from_url` to address this issue. The
easiest way to enforce this rule involved passing in the
`@strategies` key (a symbol) into the `select` block, so we can
compare it to `livecheck_strategy` (the strategy symbol specified in
the `livecheck` block).
2023-02-27 18:58:13 -05:00
Mike McQuaid
86aeac6857
Merge pull request #14805 from dduugg/extend-kernel
Move Kernel extensions into a separate file
2023-02-27 19:38:35 +00:00
Douglas Eichelberger
1a0c02ffe0 Move tests too 2023-02-27 11:22:23 -08:00
Douglas Eichelberger
2b4d4a3707 Isolate Kernel extensions 2023-02-27 11:22:10 -08:00
Douglas Eichelberger
901a179ba6 Set back utils.rb file 2023-02-27 11:19:11 -08:00
Douglas Eichelberger
056ade18c0 Duplicate utils.rb history. 2023-02-27 11:19:11 -08:00
Douglas Eichelberger
ff48ce24c4 Copy utils.rb into extend/kernel.rb 2023-02-27 11:19:11 -08:00
Douglas Eichelberger
98f4fde68c Keep utils.rb 2023-02-27 11:19:11 -08:00
Mike McQuaid
810c7681f9
Merge pull request #14824 from MikeMcQuaid/cat_better_error
dev-cmd/cat: improve error message.
2023-02-27 17:54:48 +00:00
Mike McQuaid
d6ba3878ab
dev-cmd/cat: improve error message.
Fixes #14815.

Co-authored-by: Adrian Ho <the.gromgit@gmail.com>
2023-02-27 17:34:29 +00:00
Mike McQuaid
5eddc77baa
Merge pull request #14822 from maxim-belkin/wslview-win
Use 'wslview' instead of 'xdg-open' on Windows
2023-02-27 17:13:32 +00:00
Maxim Belkin
2b008ae7fd os/linux.rb: wsl_version: apply suggestions from code review
Co-authored-by: Mike McQuaid <mike@mikemcquaid.com>
2023-02-27 16:56:28 +00:00
Maxim Belkin
c9b289fc3d Use 'wslview' instead of 'xdg-open' on Windows 2023-02-27 14:39:56 +00:00
Mike McQuaid
a7a3ecacba
Merge pull request #14804 from Bo98/cask-readall
readall: reject casks with no URL
2023-02-27 13:41:46 +00:00
Mike McQuaid
ee65414742
Merge pull request #14816 from issyl0/predicate-fork-exists-method
utils/github: Tiny improvements, boolean methods end in `?` and remove unnecessary `.delete_prefix("/")`
2023-02-27 13:34:01 +00: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
Mike McQuaid
4d0154fa79
Merge pull request #14806 from Homebrew/dependabot/bundler/Library/Homebrew/concurrent-ruby-1.2.1
build(deps): bump concurrent-ruby from 1.2.0 to 1.2.1 in /Library/Homebrew
4.0.4
2023-02-27 12:45:49 +00:00
Issy Long
a2d31faa72
dev-cmd/contributions: Support date ranges in PR reviews query
- Now `brew contributions --from=2023-02-23 --to=2023-02-26` works to limit the
  results for reviews. I forgot this in the original implementation, again,
  ugh.
2023-02-26 23:34:53 +00:00
apainintheneck
fdc2e9f3f5 Merge branch 'master' into delay-loading-from-cask-source-api 2023-02-26 14:50:13 -08:00
Rylan Polster
06cf85ffd4
Merge pull request #14814 from Rylan12/fix-from-content-tap-loading
Set tap for casks when loading from contents via API
2023-02-26 16:58:21 -05:00
apainintheneck
9af04fdf38 Add installer tests 2023-02-26 11:26:44 -08:00
Bo Anderson
09f4be844f
Merge pull request #14817 from Homebrew/sorbet-files-update
sorbet: Update RBI files.
2023-02-26 17:08:11 +00:00
Issy Long
214e2102c3
utils/github: Remove unnecessary .delete_prefix("/")
- This workaround was originally added in 2020. I have confirmed with
  https://api.github.com/search/code?q=brew+language%3Aruby+org:Homebrew that
  the `path` string no longer has a leading `/`.
2023-02-26 15:27:02 +00:00
Issy Long
550599d03b
utils/github: Switch check_fork_exists to fork_exists?
- It's Ruby style convention that methods that return only booleans end with a
  question mark.
2023-02-26 15:26:07 +00:00
Issy Long
a13556a1a6
Merge pull request #14813 from issyl0/contributions-approvals 2023-02-26 15:23:11 +00: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
BrewTestBot
85cebc5c8f
sorbet: Update RBI files.
Autogenerated by the [sorbet](https://github.com/Homebrew/brew/blob/master/.github/workflows/sorbet.yml) workflow.
2023-02-26 00:32:18 +00:00
Issy Long
591afa8ee0
utils/github: Appease brew style line length 2023-02-25 22:27:48 +00:00
Issy Long
66303bd092
Merge pull request #14812 from issyl0/contributions-order-maintiainers
dev-cmd/contributions: Order the CSV by highest contributions total
2023-02-25 22:20:45 +00:00
Issy Long
99d2bb9a53
utils/github: Use search_results_items method for code search 2023-02-25 22:01:12 +00: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
Rylan Polster
29bb0ee3bf
Set tap for casks when loading from contents via API 2023-02-25 16:24:58 -05:00
Issy Long
8c75eab88a
dev-cmd/contributions: Count PR reviews since they're super important
- The search APIs don't have that high a rate limit but we shouldn't need to
  worry about that too much because, to get counts, the JSON response comes
  with a `total_count` number.
2023-02-25 19:10:17 +00:00
Issy Long
0233851031
Merge pull request #14811 from Homebrew/sponsors-maintainers-man-completions
Update manpage and completions.
2023-02-25 18:10:25 +00:00
Issy Long
7b8f1c8714
dev-cmd/contributions: Order the CSV by highest contributions total 2023-02-25 18:04:01 +00:00
BrewTestBot
5d406ae54a
Update manpage and completions.
Autogenerated by the [sponsors-maintainers-man-completions](https://github.com/Homebrew/brew/blob/HEAD/.github/workflows/sponsors-maintainers-man-completions.yml) workflow.
2023-02-25 17:52:54 +00:00
Issy Long
428193aa29
Merge pull request #14789 from issyl0/contributions-maintainers-csv
dev-cmd/contributions: CSV output of totals per maintainer
2023-02-25 17:51:59 +00:00
Issy Long
e68379f5df
dev-cmd/contributions: Fill in the "total" CSV row
- Using the new "total across commits/coauthors/signoffs" data per-user,
  this also generates a more complete maintainers CSV.
2023-02-25 01:05:41 +00:00
Bo Anderson
0172ad1028
Merge pull request #14794 from Bo98/api-check-shell
Move `HOMEBREW_NO_INSTALL_FROM_API` defaults to shell
2023-02-25 00:33:37 +00:00