169 Commits

Author SHA1 Message Date
Markus Reiter
480e264d9a
Lint Ruby docs. 2024-05-01 11:35:21 +02:00
Markus Reiter
0b56d0be4a
Document Tab.for_keg and use Keg#tab where possible. 2024-04-28 20:50:13 +02:00
Markus Reiter
0f0055ede4
Make documentation @api private by default. 2024-04-26 19:04:20 +02:00
Douglas Eichelberger
c59d9fa833 Prefer numbered block params over proc conversion, cont'd 2024-04-08 09:47:27 -07:00
Bo Anderson
bc7c274e17
cleanup: handle some edge cases 2024-04-01 14:47:52 +01:00
Mike McQuaid
87bf4af3fc
Merge pull request #16872 from cho-m/cleanup-cask-broken-symlinks
cleanup: remove broken symlink for uninstalled migrated Casks
2024-03-31 19:30:02 +01:00
Bo Anderson
58de9e0dda
cleanup: better support bottle manifests 2024-03-30 03:30:58 +00:00
Bo Anderson
92d44912e2
cleanup: better handle version_scheme scenarios 2024-03-30 03:30:31 +00:00
Michael Cho
3ddc196f11
cleanup: remove broken symlink for uninstalled migrated Casks
Signed-off-by: Michael Cho <michael@michaelcho.dev>
2024-03-21 17:52:48 -04:00
Michael Cho
29175df63f
cleanup: track removed links & dirs during dry-run
This allows dry-run to display any directories that will be removed
as a result of previous removal steps.

Signed-off-by: Michael Cho <michael@michaelcho.dev>
2024-03-10 19:02:49 -04:00
Mike McQuaid
ea2892f8ee
brew.rb: handle missing args. 2024-03-07 16:20:20 +00:00
Markus Reiter
e0743a1436
Reapply "Refactor Formulary::loader_for."
This reverts commit 24683525cb5abf3cc79a9e0e268fa6efd0af558b.
2024-02-22 18:24:57 +01:00
Mike McQuaid
24683525cb
Revert "Refactor Formulary::loader_for." 2024-02-16 13:41:54 +00:00
Markus Reiter
b717f5d954
Remove unused TapFormulaWithOldnameAmbiguityError. 2024-02-14 22:56:25 +01:00
Issy Long
0e27dc2564
Fix RuboCop Style/ArrayIntersect offenses 2024-01-18 14:11:43 +00:00
Douglas Eichelberger
ffd761d2e9 Create dedicated Attrable mixin for attr_ methods 2023-12-28 11:46:27 -08:00
Bo Anderson
489879ff72
Enable Ruby 3 for all users 2023-11-29 15:30:17 +00:00
Branch Vincent
e58ed46195
formula: add PIP_CACHE_DIR to build env 2023-11-22 13:53:05 -08:00
Bo Anderson
5c819100fe
cleanup: smarter gem handling 2023-11-07 22:28:03 +00:00
Bo Anderson
4ec450823c
Portable Ruby 3.1.4 (opt-in beta) 2023-10-27 15:58:43 +01:00
Carlo Cabrera
43b6d79a4c
cleanup: handle GitHub Actions artifacts
Implemented based on feedback from #15440.
2023-05-17 21:11:16 +08:00
Markus Reiter
a3231a03fa
Implement cask renames. 2023-05-12 21:17:30 +02:00
Bo Anderson
0daa4d98cf
cleanup: fix version error for cache items without a version 2023-05-11 13:44:26 +01:00
Bo Anderson
44f058edb5
Refactor formula, cask and Ruby source downloads to use shared code 2023-04-27 23:23:07 +01: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
Douglas Eichelberger
a7b80532bf Code review changes 2023-03-27 09:28:27 -07:00
Douglas Eichelberger
eaeceda31e Enable typing in Homebrew::Cleanup 2023-03-25 13:16:11 -07:00
Issy Long
e9d994622e
rubocop: Drop "f" from Naming/MethodParameterName allowlist
- This either stands for "file" but more often than not "formula".
2023-03-11 00:17:27 +00: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
Douglas Eichelberger
24e7c2c5bd Remove active_support Time extensions 2023-02-04 13:51:35 -08:00
Mike McQuaid
6a25229567
brew style --fix 2023-01-02 19:18:51 +00:00
apainintheneck
d69326c8d0 Move ::Cleanup check to extend/os 2022-11-23 20:38:40 -08:00
apainintheneck
f068f74f55 Move autoremove code to util and add tests 2022-09-13 23:23:48 -07:00
Carlo Cabrera
55f27b932a
Merge pull request #13715 from carlocab/python-site-packages
cleanup: handle Python `site-packages` directories
2022-08-31 21:08:14 +08:00
Carlo Cabrera
155f4d7394
Fix collection of unused_pyc_files. 2022-08-31 16:04:21 +08:00
apainintheneck
98e6e6e31f Ignore HOMEBREW_NO_CLEANUP_FORMULAE deps in brew autoremove 2022-08-22 20:10:14 -07:00
Carlo Cabrera
7384bd2b3f
cleanup: use cleanup_path more consistently
`cleanup_path` already handles the dry-run logic, and also includes
those paths in the summary of space freed by `brew cleanup`.

Before this change:

    ❯ brew cleanup --dry-run
    Would remove: /Users/carlocab/Library/Caches/Homebrew/bootsnap (2,401 files, 41.9MB)

After this change:

    ❯ brew cleanup --dry-run
    Would remove: /Users/carlocab/Library/Caches/Homebrew/bootsnap (2,401 files, 41.9MB)
    ==> This operation would free approximately 41.9MB of disk space.
2022-08-18 21:28:51 +08:00
Carlo Cabrera
0b48261f79
cleanup: handle Python site-packages directories
Inside a given `site-packages` directory, *.pyc files live in
`__pycache__` directories. These are created by the Python interpreter
when a module is imported in order to speed up future access to the
imported module.

These can be left behind when formulae are uninstalled, which results in
erroneous success in importing the modules they were originally compiled
for.

Let's fix that by cleaning these up. In the top-level `__pycache__`
directory, we use the `Pathname#prune?` extension in order to determine
whether a `*.pyc` file is old enough to clean up. In other directories,
we clean them up when they are all that remains in a given module's
tree.

Removing these `*.pyc` files will make `python3` regenerate them when
required, so deleting them is relatively safe. The worst consequence is
slightly slower module import times.

Closes #13701.
2022-08-18 21:09:12 +08:00
fn ⌃ ⌥
dce57eaad6 Always print install cleanup disable message for periodic clean 2022-08-04 07:46:31 -07:00
fn ⌃ ⌥
71ab2f6e7a Run periodic cleanup after installing all packages 2022-08-04 07:46:31 -07:00
apainintheneck
cb91f8b665 Add tests for retrieving formula based on dependents
Also, made sure to clear formula cache before
and after autoremoving packages.
2022-07-17 00:39:23 -07:00
apainintheneck
fe83500617 Moved autoremove logic into cleanup.rb and formula.rb
Cleanup.rb:
- Added #autoremove method
- #autoremove is called in clean when HOMEBREW_AUTOREMOVE is set

Formula.rb:
- Added #unused_formulae_with_no_dependents and helpers

Removed old autoremove.rb module.
2022-07-14 13:16:26 -07:00
Bo Anderson
02164a35db
Use ORIGINAL_PATHS over envs; reject nil PATH 2022-06-17 19:47:57 +01:00
Émilia Decaudin
6642801b04 Show total disk space freed on cleanup. 2022-03-07 12:25:27 -05:00
Mike McQuaid
5ebf3acc94
Revert "cleanup: check if symlinks are readable." 2022-01-25 12:10:50 +00:00