1486 Commits

Author SHA1 Message Date
Markus Reiter
73f1629fa1
Merge pull request #16624 from reitermarkus/avoid-t-must
Avoid `T.must`.
2024-02-10 12:38:43 +01:00
Markus Reiter
5cc1ddc5c5
Use numbered block parameter.
Co-authored-by: Douglas Eichelberger <697964+dduugg@users.noreply.github.com>
2024-02-09 17:03:01 +01:00
Markus Reiter
a20d95b1b5
Simplify conditionals. 2024-02-09 16:51:35 +01:00
Markus Reiter
1d549c4815
Avoid T.must. 2024-02-08 20:07:01 +01:00
Markus Reiter
8cbb5566b6
Remove unused methods. 2024-02-08 20:06:48 +01:00
Kevin
d94772171f
Merge pull request #16541 from apainintheneck/next-gen-api-formula-json-v3
Next gen api formula json v3
2024-02-04 11:16:01 -08:00
Eric Knibbe
e63b1f4da5
docs: monospace suggested values 2024-02-04 15:42:26 +01:00
apainintheneck
54b54b7e93
formula: change how #to_hash is defined for backwards compatibility
Now the output of commands like `brew info --json=` and
`brew generate-formula-api` should be the same as before along with
the additional files for the internal API. Before this commit the
hash key order had changed.
2024-02-04 13:50:57 +01:00
apainintheneck
3c503cdf56
Normalize service serialization method names 2024-02-04 13:50:57 +01:00
apainintheneck
d9a98ac4ec
Address review feedback
- move caveats serialization to a method
- remove unnecessary nesting where the hash would only have one key

Also, removed comment about checking disable and deprecation reasons.
2024-02-04 13:50:57 +01:00
apainintheneck
ba3a0f8c33
dev-cmd/generate-formula-api: generate homebrew-core.json
This adds the code to generate the homebrew-core.json file which
represents the entire tap instead of just the previous array of
formula hashes. Any shared logic has been moved into the top-level
hash scope including aliases, renames, tap_git_head and tap_migrations.

I also added a check to skip adding the variations hash to the api
hash if it is empty.

Now we're down to 10MB from 24MB!!!
2024-02-04 13:50:57 +01:00
apainintheneck
69609731d9
formula: share dependencies serialization logic
Note: This changes where the "head_dependencies" key in the hash
shows up but not the hash's contents.

"head_dependencies" now shows up directly after all of the other
dependency keys. Before it was always at the end of the hash after
variations.
2024-02-04 13:50:57 +01:00
apainintheneck
d2dd80b0d6
formula: share requirements serialization logic 2024-02-04 13:50:57 +01:00
apainintheneck
c1d85bf598
formula: add #to_api_hash
This will be used internally to generate a slimmer api hash representation
of formulas that will require less space and be faster to load.

Changes:
- Added #to_api_hash
- Modified #to_hash_with_variations to work with both #to_hash and #to_api_hash
- Modified #bottle_hash to have compact representation for the api hash
- Added #urls_hash to share url hash generation logic between the hash methods
2024-02-04 13:50:57 +01:00
Mike McQuaid
65bf26fb27
Merge pull request #16416 from Bo98/safe-filename
Add consistent path validation
2024-01-01 18:48:28 +00:00
Bo Anderson
5aebde3ffd Add consistent path validation 2024-01-01 18:37:47 +00:00
Douglas Eichelberger
ffd761d2e9 Create dedicated Attrable mixin for attr_ methods 2023-12-28 11:46:27 -08:00
Douglas Eichelberger
3abbf4447e Some minor regexp match perf improvements 2023-12-27 13:16:36 -08:00
Michael Cho
2b58d9d9a1
formula: allow changing std_configure_args prefix 2023-12-20 10:08:27 -05:00
Patrick Linnane
9dee80cb2d
various: fix style errors 2023-12-18 09:34:01 -08:00
Rylan Polster
036723a668
Add deprecate! and disable! methods to the Cask DSL 2023-12-16 20:01:46 -05:00
Bo Anderson
5692c8ecbf
Fix style violations under newer RuboCop 2023-12-14 05:47:12 +00:00
Mike McQuaid
beb9799265
cmd/untap: fix untapping syntax failure.
If an installed cask is invalid on attempting an untap: it will
prevent untapping that cask.

Fix this in two ways: one more specific to `untap` and one more
generally to other commands too:
- specific: only read the actual formulae/casks from the tap we're
  untapping instead of all of those that are installed
- general: rescue more exceptions in `Cask::Caskroom.casks` (like we
  already do for `Formula.installed`
2023-12-13 13:54:37 +00:00
Bo Anderson
b42256d286
Deprecate, disable & delete code for Homebrew 4.2.0 2023-12-07 23:42:13 +00:00
Bo Anderson
fe011ca0f9
Partially support pour_bottle? in API 2023-12-07 18:05:41 +00:00
Bo Anderson
27730f68c5
formula: fix specified_path for aliases without core tap 2023-12-01 17:00:15 +00:00
Mike McQuaid
1b8207bf47
Merge pull request #16250 from branchvincent/pip-cache
formula: add `PIP_CACHE_DIR` to build env
2023-11-23 12:54:01 +00:00
Mike McQuaid
1e2cdc6eac
formula: tweak cache ordering. 2023-11-23 12:38:51 +00:00
Branch Vincent
e58ed46195
formula: add PIP_CACHE_DIR to build env 2023-11-22 13:53:05 -08:00
Rylan Polster
8704e79cc0
Separate MacOS references 2023-11-15 18:19:39 -05:00
Mike McQuaid
ff404fe5ab
Merge pull request #16184 from dduugg/rm-try
Remove use of ActiveSupport try
2023-11-06 13:11:01 +00:00
Douglas Eichelberger
00ba09d73d Remove use of ActiveSupport try 2023-11-05 09:28:19 -08:00
Douglas Eichelberger
0191af7899 resolve typecheck errors 2023-11-05 08:55:58 -08:00
Eric Knibbe
03e743a75e
api: add using: attribute to head & stable URLs 2023-10-11 14:14:18 -04:00
Mike McQuaid
6b01bc1773
Merge pull request #16007 from Bo98/better-readall
Improve performance of `brew readall`
2023-09-28 14:44:21 +01:00
Bo Anderson
0c08a3cccb
Improve performance of Formula#to_hash 2023-09-28 14:07:25 +01:00
Bo Anderson
e4623cc8f4
Improve performance of brew readall 2023-09-28 14:05:09 +01:00
apainintheneck
5760ae4fb2 cmd/readall: Cleanup todos
- keep running the command against all os/arch combinations
  as the default
- remove todos and deprecations related to changing the behavior
- create constants for os/arch combinations
2023-09-19 21:33:13 -07:00
apainintheneck
7e05a9b574 cmd/audit: improve performance of versioned formula names
There is a check for other versioned formula with the same name
in the file audit. This just memoizes all of the versioned
formulae in a tap during the first call and then uses that much
shorter list everytime it checks for things.
2023-09-16 09:18:13 -07:00
Bo Anderson
be2834ace8
formula: add global caching for declared_runtime_dependencies 2023-09-15 03:08:27 +01:00
Sam Ford
578c935bcf
Formula, BuildError: Update type signatures
We're seeing type errors when building formulae that use something
like `xcodebuild ..., "-arch", Hardware::CPU.arch`, since `CPU.arch`
is a symbol. We've been addressing these issues by calling `#to_s` on
the value but there was some talk about simply expanding the type
signatures to accommodate anything that will be cast to a `String`.

There's maybe still an argument to be made for doing string conversion
in formulae but expanding the type signatures will resolve a number of
existing type errors if we simply want to rely on implicit type
casting.

Past that, this also updates the type signature for `BuildError` to
align with the `#system` signature changes, as we receive a type error
otherwise.
2023-09-13 19:16:04 -04:00
Eric Knibbe
931f762598
docs+rubydoc: various grammar/wording fixes 2023-09-11 02:26:37 -04:00
Eric Knibbe
bd659ce4d0
formula: fixes for rubydoc output
in particular, #generate_completions_from_executable
2023-09-09 14:54:45 -04:00
hyuraku
08c4e6848e remove useless require 2023-09-08 22:52:33 +09:00
hyuraku
adc2a2fea1 remove ARGV from Formula#all 2023-09-02 19:35:22 +09:00
Branch Vincent
f8ab19d187
formula: drop old pip feature flag 2023-08-26 12:48:16 +01:00
Mike McQuaid
d313e8b027
Merge pull request #15824 from dduugg/inreplace-static
Make inreplace a purely static method v2
2023-08-08 12:32:10 +01:00
Douglas Eichelberger
5d5c22e104 Replace integration test with unit test 2023-08-07 18:32:08 -07:00
Douglas Eichelberger
2b29c498fa s/blk/block 2023-08-07 17:26:46 -07:00
Branch Vincent
61d23fef53
formula: use pip's --no-compile 2023-08-05 16:39:29 -07:00