308 Commits

Author SHA1 Message Date
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
Eric Knibbe
b3ecd91f97
dev-cmd/edit: suggest tapping core repositories 2023-08-01 13:39:28 -04: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
Bo Anderson
68289f1165
Add without_api specifier for CLI named args 2023-06-22 01:57:28 +01:00
Markus Reiter
486c3765ce
Add --os=all and --arch=all options. 2023-05-17 15:26:46 +02:00
Markus Reiter
a3231a03fa
Implement cask renames. 2023-05-12 21:17:30 +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
Markus Reiter
bdd6523ce8
Deprecate appcast. 2023-03-30 03:29:06 +02:00
Markus Reiter
c38f0c3aae
Fix typecheck. 2023-03-26 09:26:36 +02:00
Markus Reiter
3da305fa80
Add keyboard_layout stanza. 2023-03-26 08:14:24 +02:00
Douglas Eichelberger
04f7258009 brew style --fix 2023-03-13 11:24:49 -07:00
Douglas Eichelberger
e5a392c256 T.unsafe is now safe 2023-03-13 10:46:39 -07:00
Douglas Eichelberger
b7d2953412 enable typing in --env 2023-03-03 19:12:33 -08:00
Douglas Eichelberger
d98b7845d3 Enable typing in misc files 2023-03-03 08:29:26 -08:00
Douglas Eichelberger
f9f73f3ef6 Tidy up 2023-02-27 21:42:47 -08:00
Douglas Eichelberger
1ab278f74c Fix style/type violations 2023-02-27 20:34:07 -08:00
Douglas Eichelberger
0eccc0e987 git grep -l Utils::Inflection | xargs gsed -i 's|Utils::Inflection|Utils|g' 2023-02-27 20:18:27 -08:00
Douglas Eichelberger
2400c6daed brew style --fix 2023-02-27 20:17:33 -08:00
Douglas Eichelberger
37015b6b08 Change to pluralize, port more call sites 2023-02-27 20:17:33 -08:00
Issy Long
214110f665
dev-cmd/contributions: Stats for all maintainers
- With `brew contributions`, this will output a list of stats
  (across the specified time period, or all time) for people in the
  "maintainers" team on GitHub.
- Add a `--user` flag for getting stats for a specific user (either
  username, name or email address).
- This assumes that their Git committer details are the same as their name is
  set to on GitHub.
- Show an error message if trying to generate a CSV for the full maintainer
  list, since I haven't worked out how to best show all of that info yet (or
  even how best to show only the totals across everything for every user) in
  that format.
2023-02-22 16:05:58 +00:00
Issy Long
2719c345ab
dev-cmd/contributions: CSV output of queried repos; shorter sentence
- This gives users of this command a `--csv` option to pass to... you guessed
  it, generate a CSV that's `pbcopy`able elsewhere, for more granular
  breakdowns of where a person contributed.
- Inspiration was taken from the mockup in
  https://github.com/Homebrew/brew/issues/13642#issuecomment-1254535251
  but without the extra dependency of the TerminalTable gem.
- Always print a condensed "total contributions" sentence.

Output:

```
$ brew contributions issyl0
The user issyl0 has made 1201 contributions in all time.

$ brew contributions issyl0 --csv
user,repo,commits,coauthorships,signoffs
issyl0,brew,331,13,0
issyl0,core,473,24,326
issyl0,cask,4,0,0
issyl0,aliases,0,0,0
issyl0,autoupdate,1,0,0
issyl0,bundle,14,2,0
issyl0,command-not-found,1,0,0
issyl0,test-bot,3,0,0
issyl0,services,9,0,0
issyl0,cask-drivers,0,0,0
issyl0,cask-fonts,0,0,0
issyl0,cask-versions,0,0,0
```
2023-02-15 12:47:10 +00:00
EricFromCanada
dfc9906184
internal messaging fixes 2023-02-10 23:17:16 -05:00
Issy Long
1ce6a38730
cli/parser: Casks can be specified with --cask or --casks 2023-01-28 12:55:57 +00:00
Issy Long
8881ea74b5
cli/parser: Don't treat args with --cask as formulae
- For the command `brew install --cask racket`, a user was reporting the
  behaviour where despite `--cask` in the command, they were getting
  output about the `racket` formula having been renamed:

```
$ brew install --cask racket
Warning: Use minimal-racket instead of deprecated racket
==> Downloading https://mirror.racket-lang.org/installers/8.7/racket-8.7-x86_64-macosx-cs.
==> Installing Cask racket
[...]
racket was successfully installed!
```

- The "instead of deprecated ..." messaging comes from the `TapLoader`
  class `formula_name_path` method, so _something_ must be assuming
  that everything is initially a formula before _later_ learning from
  further args parsing that there's a `--cask` qualifier to scope to
  only casks.

- There are always `@formula_options` and args parsing is recursive,
  going through each option, so we check that the original `argv` items
  include a `--cask` and skip calling the `formulae` method if that's
  the case.

- After this change, the "formula renames" words no longer show up.

```
$ brew install --cask racket
==> Downloading https://mirror.racket-lang.org/installers/8.7/racket-8.7-aarch64-macosx-cs.dmg
==> Installing Cask racket
[...]
racket was successfully installed!
```
2023-01-27 21:49:20 +00:00
apainintheneck
ad57705029 All --cask for linux dev cmds
This ability was removed around a month
ago but needs to be added back in.

Developers want to be able to use the
`bump` and `audit` commands when on Linux.
This is especially useful for CI.
2023-01-08 17:34:52 -08:00
apainintheneck
a8384c0ce7 cli/parser: Better error message for cask on linux
1. Validate options before constraint violations. This allows
us to error out when --cask is passed on Linux before getting
a constraint violation when --cask and --formula are set.
2. Skip printing the help page when --cask is passed on Linux.
2022-12-31 12:34:18 -08:00
apainintheneck
35500130c4 Update parser tests
- Remove named_args linux specs now that that
  logic has been moved to the parser
2022-12-04 23:02:44 -08:00
apainintheneck
b7e28ef48f Make :formula? the default on Linux
This makes :formula? the default whenever
defined throughout the codebase on Linux.
It also makes :cask? illegal for all Linux
users.
2022-12-04 19:43:12 -08:00
Bo Anderson
eac32f0b20
Additional fixes for Ruby 3 compatibility 2022-10-18 01:54:59 +01:00
Bo Anderson
bde685aae2
Merge pull request #13982 from Bo98/ruby3-part1
Preliminary compatibility fixes for Ruby 3
2022-10-11 19:42:57 +01:00
Rylan Polster
174087958b
Simulate all OS/arch combinations in brew readall 2022-10-10 23:56:37 -04:00
Bo Anderson
9b99594753
Preliminary compatibility fixes for Ruby 3 2022-10-11 02:53:27 +01:00
Mike McQuaid
c49f2e8b4c
Merge pull request #13941 from apainintheneck/default-no-casks-on-linux
Warn linux users about using --cask
2022-10-04 09:39:28 +01:00
apainintheneck
6301de9dcc Move Args#only_formula_or_cask to extend/os/linux 2022-10-03 18:13:33 -07:00
apainintheneck
5d27b70757 Set --formula by default on linux 2022-10-01 17:28:07 -07:00
apainintheneck
020c50e588 Warn linux users about using --cask 2022-10-01 16:11:39 -07:00
Mohammad Zain Abbas
e058da1706 Merge branch 'master' into mohammad 2022-09-14 05:19:50 +02:00
Mike McQuaid
e2759fbdff
Deprecate reading all formulae through commands
We added the `--all` flag (now renamed to `--eval-all`) for various
commands for this behaviour so let's start deprecating this.

Also, introduce a `HOMEBREW_EVAL_ALL` environment variable to use the
existing, less secure, behaviour by default and avoid passing
`--eval-all` everywhere.
2022-09-05 13:57:22 +01:00
Mohammad Zain Abbas
461ae71229
Merge branch 'Homebrew:master' into mohammad 2022-08-23 14:27:47 +02:00
Lukas Oberhuber
3d60d610dd Merge branch 'master' into debug-symbols 2022-08-10 18:44:09 -10:00
Mohammad Zain Abbas
105135ed91
Merge branch 'Homebrew:master' into mohammad 2022-08-06 14:59:14 +02:00
Issy Long
c02e03a179
dev-cmd/contributions: Use methods to get arguments
- I got these with hash syntax because I couldn't figure out Sorbet, but
  there's `args.rbi` to add the CLI args methods to. Nice!
- In doing this I realised that `--repositories` is required again, we
  no longer infer `--repositories=all` from no `--repositories` passed
  as we did in a previous version of this.
2022-08-03 16:53:55 +01:00
Mohammad Zain Abbas
26cdf02506 Fix typecheck issues for livecheckable resources 2022-08-02 00:52:01 +02:00
Lukas Oberhuber
d195f22522 Connecting up --debug-symbols flag
This connects the calling of dsymutil and the retention of temporary
files. Still need to connect compilation to flag.
2022-07-26 12:15:53 +01:00
Rylan Polster
1e536217b2
Streamline loading casks from API 2022-06-15 16:35:49 -04:00
Bo Anderson
1d36c42fb7
Support offline usage under HOMEBREW_INSTALL_FROM_API 2022-06-14 16:06:05 -04:00
apainintheneck
1d5c668110 Remove unused parser option required_for 2022-06-08 15:23:58 -07:00
Bevan Kay
183cbe0001
named_args: handle additional cask exception 2022-06-02 12:21:44 +10:00
Mike McQuaid
fdefffc0a5
named_args: better handle keg-like casks.
Need to ensure we're using the installed caskfile when it's requested
and readable.

Follow-up from https://github.com/Homebrew/brew/pull/13289 addressing
https://github.com/Homebrew/brew/pull/13289#discussion_r884853652
2022-05-31 09:06:52 +01:00