51 Commits

Author SHA1 Message Date
Mike McQuaid
0940fb78dc
Fix usage of Tab#installed_(on_request|as_dependency)
These can return `true`, `false` or `nil` so adjust the signature to
note this and fix the call sites to ensure we don't accidentally pass
through `nil` values when we shouldn't.

While we're here, make a `TODO` to fix this bad API up in future.

Fixes https://github.com/Homebrew/brew/issues/19076
2025-01-13 09:24:42 +00:00
Issy Long
6d8c21bd7a
cmd/leaves: Bump to Sorbet typed: strict 2024-08-10 23:55:13 +01:00
Ruoyu Zhong
0b668797ec
cmd/leaves: fix an undefined method error
Follow-up to #17168.

Fixes #17199.
2024-05-02 01:07:29 +08:00
Markus Reiter
0b56d0be4a
Document Tab.for_keg and use Keg#tab where possible. 2024-04-28 20:50:13 +02:00
Douglas Eichelberger
c59d9fa833 Prefer numbered block params over proc conversion, cont'd 2024-04-08 09:47:27 -07:00
Douglas Eichelberger
65f8420232 Make things private 2024-03-30 16:43:11 -07:00
Douglas Eichelberger
8ab9d2cbad Port Homebrew::Cmd::Leaves 2024-03-30 16:16:52 -07:00
wickles
45cfb12a98 cmd/leaves: add missing cask dependency 2023-06-20 09:38:24 -07:00
Mike McQuaid
5424cdfffd
cmd/leaves: tweak wording. 2023-06-20 14:43:42 +01:00
hyuraku
3df4fa6803 remove cask's depencies from brew/leaves 2023-06-20 22:37:39 +09:00
Douglas Eichelberger
24cf6076e8 brew style --fix 2023-04-24 20:42:39 -07:00
apainintheneck
ae17d3cffd autoremove: ignore build deps when built from src
Now the build dependencies of formula that were installed from
source will not be removed by `brew autoremove`. This is especially
helpful for those who've installed brew in an alternative prefix.
2022-09-09 21:54:32 -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
Mike McQuaid
d849b5018d
cmd/leaves: tweak naming. 2021-05-13 13:15:40 +01:00
cnnrmnn
c20c7c8be5 Make flags mutually exclusive 2021-05-12 10:37:59 -04:00
cnnrmnn
8764c4fc21 Fix proc coercion 2021-05-12 10:08:11 -04:00
Connor Mann
e4e641cd77
Update Library/Homebrew/cmd/leaves.rb
Co-authored-by: Mike McQuaid <mike@mikemcquaid.com>
2021-05-12 10:05:02 -04:00
Connor Mann
47a64822ba
Update Library/Homebrew/cmd/leaves.rb
Co-authored-by: Carlo Cabrera <30379873+carlocab@users.noreply.github.com>
2021-05-12 09:36:51 -04:00
cnnrmnn
5cc98d2819 Add --installed-(on-request/as-dependency) flags 2021-05-11 17:32:24 -04:00
Rylan Polster
d1f3e39b7b
Update commands to generate usage banner 2021-01-18 21:20:11 -05:00
Rylan Polster
da811373d3 Add named_args DSL for commands 2021-01-13 17:09:42 -05:00
Markus Reiter
5be4c9b5e0 Upgrade typed sigils. 2020-11-25 17:04:19 +01:00
Markus Reiter
da9289eff0 Add more type signatures. 2020-11-13 12:26:36 +01:00
Tie
afd7bb8889 make suggestions 2020-11-05 12:27:22 -05:00
Tie
f95e1729a2 move logic from leaves to formula 2020-11-04 16:45:14 -05:00
Markus Reiter
24ae318a3d Move type annotations into files. 2020-10-10 14:59:39 +02:00
Markus Reiter
d4c2ffd705 Refactor CLI::Parser. 2020-07-31 15:07:17 +02:00
EricFromCanada
aea6d79d21 option parser: check for extra named args 2019-12-15 00:04:45 -05:00
Mike McQuaid
3f348286f9
cmd/leaves: handle missing formula.
Use `runtime_formula_dependencies` which does this for us.

Fixes #6827.
2019-12-10 15:44:14 +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
EricFromCanada
b4303cd983 manpages: fix command & option descriptions 2019-08-20 09:03:33 -04:00
Mike McQuaid
36dbad3922
Add frozen_string_literal to all files. 2019-04-20 13:27:36 +09:00
Mike McQuaid
e40b171127
Rename cli_parser to cli/parser. 2019-04-17 22:16:50 +09:00
Mike McQuaid
6cb7a00f2d
cmd: remove --help headers and tweak docs. 2019-01-30 21:39:28 +00:00
Gautham Goli
2ff0b6471a
leaves: Use CLI::Parser to parse args 2018-11-11 19:13:28 +05:30
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
ce9c8c6808 cmd/leaves: handle missing formulae.
We can't get dependencies of unavailable formulae so don't try.

Fixes #3995.
2018-03-29 10:58:01 +01:00
Mike McQuaid
05d06bcc50 cmd/leaves: general cleanup. 2018-03-27 14:52:47 +01:00
Maxim Belkin
313410035d
leaves: account for requirements 2017-10-20 14:21:21 -05:00
Dominyk Tiller
795c7170e3
leaves: pass explicit sort to handle APFS 2017-10-14 06:18:49 +01:00
Markus Reiter
0ab750bf24 Use module_function for commands. 2016-10-02 00:24:47 +02:00
Xu Cheng
820b6347b8
remove unnecessary Tab.for_formula
We already loaded tab in ARGV.resolved_formulae or Formulary.from_rack
2016-07-18 18:11:53 +08:00
Max Nordlund
fa1fd70a37 Add all the top level comments 2016-04-10 22:59:25 +02:00
BrewTestBot
13d544e11e Core files style updates.
Closes Homebrew/homebrew#42354.

Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
2015-08-03 13:22:35 +01:00
Xu Cheng
4d27fe0979 leaves: use Formula#full_name 2015-05-29 17:02:22 +08:00
Jack Nagel
285f8f77e6 Tab#with? accepts the same types as BuildOptions#with? 2014-10-09 00:20:15 -05:00
Jack Nagel
5247f44205 leaves: load tab outside of the inner loop 2014-10-09 00:20:15 -05:00
Jack Nagel
10a1952d2c Only "extend self" once on the Homebrew module 2014-06-19 13:10:36 -05:00
Troels Thomsen
fdf5ecf4bb Use name of formula rather than name of dependency
Closes Homebrew/homebrew#27192.

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2014-03-04 16:00:25 -06:00