60 Commits

Author SHA1 Message Date
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
Douglas Eichelberger
26eda5a303
git grep -l '^describe' | xargs gsed -i 's|^describe|RSpec.describe|g' 2024-02-19 13:57:27 +00:00
Bo Anderson
5692c8ecbf
Fix style violations under newer RuboCop 2023-12-14 05:47:12 +00:00
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
Issy Long
935649abaf
Merge pull request #15263 from Homebrew/dependabot/bundler/Library/Homebrew/rubocop-rspec-2.20.0
build(deps): bump rubocop-rspec from 2.19.0 to 2.20.0 in /Library/Homebrew
2023-04-22 18:58:03 +01:00
Issy Long
4a87c624d7
Fix new RSpec/IndexedLet offenses 2023-04-22 01:02:38 +01:00
Douglas Eichelberger
9075cbae62 brew style --fix 2023-04-21 09:58:50 -07:00
Douglas Eichelberger
ac1e6ded9a git grep -l '# typed: false' | xargs gsed -i 's|# typed: false||g' 2023-04-21 09:57:47 -07:00
Markus Reiter
bdd6523ce8
Deprecate appcast. 2023-03-30 03:29:06 +02: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
Douglas Eichelberger
24e7c2c5bd Remove active_support Time extensions 2023-02-04 13:51:35 -08:00
Carlo Cabrera
c6428d9def
Add tests for cleanup_python_site_packages. 2022-08-31 16:26:54 +08:00
Mike McQuaid
41e94afda5
Fix brew style
Fixes for https://github.com/Homebrew/brew/pull/12152.

Extracted into a separate PR so this can be merged immediately.
2021-09-30 10:13:53 +01:00
Issy Long
e1ad07190e
rubocop: Fix RSpec/ContextWording offenses
- For some of these I changed `context` to `describe` as it fit better
  rather than contriving a "when", "with" or "without", or massively
  restructuring the tests.
2021-02-19 23:30:41 +00:00
Rylan Polster
d5d7b6c3db
style: remove RSpec/MultipleDescribes violations
Co-authored-by: Nanda H Krishna <nanda.harishankar@gmail.com>
2021-02-01 20:30:51 -05:00
Rylan Polster
af40e072b0
style: remove RSpec/NamedSubject violations 2021-02-01 20:30:51 -05:00
Mike McQuaid
623e2d95af
Revert "cleanup_spec: inline path creation."
This reverts commit 3724c739f880945ec76a16ef8b9209c6440f0035.
2021-01-28 08:13:08 +00:00
Mike McQuaid
3724c739f8
cleanup_spec: inline path creation.
Let's see if this makes the test more reliable.
2021-01-27 15:06:06 +00:00
Markus Reiter
24ae318a3d Move type annotations into files. 2020-10-10 14:59:39 +02:00
Maxim Belkin
a6d29894d9 cleanup: fix and reuse portable ruby logic.
Align the logic in `cleanup_portable_ruby` with that in `ruby.sh`.

Co-authored-by: Maxim Belkin <maxim.belkin@gmail.com>
Co-authored-by: Mike McQuaid <mike@mikemcquaid.com>
2020-09-03 09:43:41 +01:00
Markus Reiter
5402500635 Refactor and document Cleanup. 2020-08-17 19:11:31 +02:00
Mike McQuaid
5dd8ead51a
Rename Formula#installed? to Formula#latest_version_installed?
This naming has always been a bit weird and confusing so let's change
it and provide a `compat` fallback for later deprecation.
2019-12-03 11:42:42 +00:00
Issy Long
341ea60807
Auto-fix Style/RedundantBegin offenses
- This also required auto-fixes for Layout/EmptyLinesAroundBlockBody and
  Layout/InconsistentIndentation once the auto-fixer had got rid of the
  "redundant begin"s.
2019-10-13 16:04:27 +01:00
Mike McQuaid
36dbad3922
Add frozen_string_literal to all files. 2019-04-20 13:27:36 +09:00
Mike McQuaid
79f3ff0a4e
cleanup: also consider ctime on prunes.
If this is an old tarball then we may end up removing it otherwise if
we've respected the `mtime` from the server on download.
2019-01-21 21:35:24 +00:00
Mike McQuaid
8144667a71
Cleanup periodically if HOMEBREW_INSTALL_CLEANUP is set.
This will become the default in a later version of Homebrew but has an
opt-out through HOMEBREW_NO_INSTALL_CLEANUP.

Also, always cleanup files older than 120 days and set the general
default value for "old" logs, casks etc. to 30 days.
2019-01-03 16:23:44 +00:00
Markus Reiter
a9128c543c Use ActiveSupport’s #days. 2018-10-07 23:10:56 +02:00
Mike McQuaid
78eba5b815
Autofix RuboCop RSpec failures 2018-09-20 13:36:42 +01:00
Mike McQuaid
7615d3a812
Improve writable directory handling
Consolidate the handling of which directories need to exist and which
need to be writable. Additionally, add a fatal check for formula
installations to ensure that any directories that need to be writable
are so before attempting an installation.

Fixes #4626.
2018-09-06 18:38:43 +01:00
Markus Reiter
a84a1c63db Rename Hbc module to Cask. 2018-09-06 09:30:52 +02:00
commitay
88bf60d589
Merge pull request #4815 from commitay/cargo-cache
rust/cargo: enable caching
2018-09-05 21:22:03 +10:00
Mike McQuaid
90b3a13909
cask: move cask/lib/hbc/* to cask/*.
Fix the load path, requires and some filenames accordingly.
2018-09-04 09:56:57 +01:00
commitay
11a6413fd0 cleanup: remove cargo_cache 2018-09-04 12:00:57 +10:00
Dominyk Tiller
b333f7abe6
cleanup_spec: test go_cache cleanup 2018-08-29 13:16:56 +01:00
Dominyk Tiller
7307d2558f
Merge pull request #4643 from chrmoritz/gclient_cache_cleanup
add new gclient_cache folder to cleanup
2018-08-13 23:18:46 +01:00
Markus Reiter
55cde526a8 Deprecate brew cask cleanup. 2018-08-13 20:09:34 +02:00
Markus Reiter
8b5fa6824b Fix brew cleanup. 2018-08-11 18:03:49 +02:00
Christian Moritz
6302d622e3 add new gclient_cache folder to cleanup 2018-08-09 00:37:58 +02:00
Markus Reiter
03b93da296 Use option parser for brew cleanup. 2018-08-08 13:11:16 +02:00
Markus Reiter
921c6a33dd Refactor Cleanup. 2018-08-08 10:40:22 +02:00
Markus Reiter
4a48297d1c Fix cleanup for files with --. 2018-08-06 15:40:05 +02:00
Mike McQuaid
9fca172d03 Fix HOMEBREW_RUBY_WARNINGS="-w"
Fix various circular requirements, method redefinitions, etc.
2018-04-07 20:28:56 +01:00
Mike McQuaid
262666c828 cleanup_spec: add nicer prune matcher alias. 2018-03-28 11:20:57 +01:00
Mike McQuaid
5e1806e796 test: rubocop-rspec style auto-corrects.
There’s too many warnings to start enabling `rubocop-rspec` by default
but let’s at least apply the cleanups it does automatically.
2018-03-25 13:30:37 +01:00
Xu Cheng
d3fce64efb
cleanup: fix removing lock files on NFS
If the underneath file system is a Network File System,
`brew cleanup` will fail to remove the lock files with following error
message:

Error: Bad file descriptor @ rb_file_flock - /path/to/the/lock_file

This commit fixes such issue and adds the corresponding test case.
2018-03-14 21:50:53 +08:00
mansimarkaur
01714b17ee Used let for sec_in_a_day and removed redundant after(:each) block 2017-08-27 01:18:41 +05:30
mansimarkaur
5f7a93bceb Corrected test name 2017-08-27 01:18:41 +05:30
mansimarkaur
ec30de69c3 Added tests for existence of files 2017-08-27 01:18:41 +05:30