192 Commits

Author SHA1 Message Date
Bo Anderson
89531e9ff3
Update all dependencies 2023-12-15 16:24:46 +00:00
Bo Anderson
5692c8ecbf
Fix style violations under newer RuboCop 2023-12-14 05:47:12 +00:00
Mike McQuaid
79a6091d08
Cask#full_name: properly output Homebrew org names
This was not returning the full name correctly for e.g. anything in
Homebrew/homebrew-fonts.

While we're here, fix up a few other places where `tap.core_cask_tap?`
can be used more appropriately.
2023-12-13 13:17:12 +00:00
Douglas Eichelberger
4a062b117c Rename block var 2023-12-12 10:19:58 -08:00
Douglas Eichelberger
e8d87fe256 Strict type livecheck/livecheck 2023-12-12 10:10:18 -08:00
Douglas Eichelberger
c75fc63d61 refactor out except! calls 2023-12-12 10:09:49 -08:00
Bo Anderson
b42256d286
Deprecate, disable & delete code for Homebrew 4.2.0 2023-12-07 23:42:13 +00:00
Bo Anderson
582049454f
vendor/bundle/ruby: cleanup unneeded files 2023-09-26 18:39:57 +01:00
apainintheneck
85bd4c7e1f utils/backtrace: scrub sorbet-runtime from backtrace
Ever since we started using this at runtime it's been polluting
the backtrace output. This makes it harder to debug errors and
increases the amount of info users have to paste into the box
when filing an issue.

This is a very direct approach. Essentially, we strip out
everything related to the `sorbet-runtime` gem whenever the top
line in the backtrace is unrelated to sorbet-runtime.

The hope is that this will allow errors related to sorbet to
be diagnosed easily while also reducing the backtrace size
for all other types of errors.

Sometimes it is useful to see the full backtrace though.
For those cases, we include the full backtrace when
`--verbose` is passed in and print a warning that the
Sorbet lines have been removed from the backtrace the
first time they are removed.

Note: This requires gems to be set up so that the call to
`Gem.paths.home` works correctly. For that reason, it must
be included after `utils/gems` which is included in
`standalone/load_path` already.
2023-09-21 21:07:22 -07:00
Sam Ford
88109b16c3
Livecheck#preprocess_url: compare with URI host
We now have a `gitea` formula in homebrew/core and its `stable` URL
uses a dl.gitea.com tarball. Since the URL's domain is gitea.com,
livecheck tries to preprocess the URL into a `.git` URL but the
resulting URL doesn't work because it's not a Git repository.

Gitea repositories use gitea.com (with no subdomain), so
`#preprocess_url` should be comparing the URI host (`dl.gitea.com`)
instead of the domain (`gitea.com`). This change allows gitea.com
repository URLs to continue to be preprocessed into a `.git` URL
while dl.gitea.com URLs are left untouched.

This makes the same change for the other domains, as they don't use
a subdomain either.
2023-09-04 00:49:23 -04:00
Patrick Linnane
1c4073df38
Livecheck: allow quiet output with --newer-only 2023-08-15 17:43:36 -07:00
Douglas Eichelberger
08e46c18cd Add type to Formula attrs 2023-07-24 14:12:36 -07:00
Bo Anderson
54a1f2005a
livecheck: fix implicit no-api handling 2023-07-10 14:50:53 +01:00
Markus Reiter
ff71668f0a
Fix type errors. 2023-05-09 01:13:55 +02:00
Sam Ford
a28e1aa422
livecheck: Selectively pass args to #find_versions
The existing way of passing values to `#find_versions` methods in
strategies leads to type issues when the Sorbet runtime is enabled.
We've also recently talked about moving away from nilable args when
we can specify a default value but this doesn't work if we pass in a
`nil` value (like we're currently doing).

This commit aims to address both of those areas by better controlling
which arguments we're passing to `#find_versions`. This approach
naively handles `cask`/`url` arguments by special-casing
`ExtractPlist`.

However, we should be checking the strategy's `#find_versions`
method for a `cask` or `url` keyword parameter. The issue is that
`strategy.method(:find_versions).parameters` is returning
`[[:rest, :args], [:block, :blk]]` instead of the actual parameters
like `[[:keyreq, :url], [:key, :regex], [:keyrest, :unused],
[:block, :block]]`.
2023-04-29 10:16:45 -04: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
Mike McQuaid
63d8de3600
brew style --fix 2023-04-07 19:10:22 +01:00
Markus Reiter
bdd6523ce8
Deprecate appcast. 2023-03-30 03:29:06 +02:00
Sam Ford
f997557c3f
livecheck: Skip #preprocess_url for new strategies
I forgot to add the new `Json`, `Xml`, and `Yaml` strategies to the
list of strategies where `#preprocess_url` should be skipped and this
was causing issues for a user in their tap. This is unfortunately
another bug that wasn't surfaced when I tested all the related checks
in our first-party taps.
2023-03-05 10:05:06 -05: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
d62211d3af Replace demodulize inflection with util 2023-02-27 20:17:33 -08:00
Douglas Eichelberger
8a01478fb1 Remove stray rubocop:enable comments 2023-02-24 08:26:22 -08:00
Markus Reiter
62ac2dda8b
Don't preprocess URL for :extract_plist strategy. 2023-02-22 10:37:51 +01:00
Issy Long
298bb65dfb
rubocop: Entirely disable Metrics cops
- These are arbitrary length limits that had a load of disables in code.
- The limits were only increasing over time rather than decreasing.
- Fixing the problematic code to be shorter would take a long time for
  questionable gain since the problem has been around so long.
2023-02-21 00:34:17 +00:00
Sam Ford
f03a400e28
Extract latest_version string to a constant 2022-12-19 18:15:51 -05:00
Nanda H Krishna
f2fbbfe70c
Enable use of latest formula version in resource livecheck URLs 2022-12-19 00:12:16 -05:00
Nanda H Krishna
b5c8841980
Modified text in comments 2022-09-27 00:59:37 -07:00
Sam Ford
bd9c436d50
Remove unnecessary parameter from method
A boolean `resource` parameter was added to `#print_latest_version`
but its only purpose is to identify whether `info` corresponds to a
resource. This can be achieved using `info[:resource].present?`, so
this additional parameter isn't necessary and can be removed.
2022-09-27 00:36:33 -04:00
Sam Ford
fb653c00d8
Improve consistency of *_version methods
Minimizing the differences between the `#resource_version` and
`#latest_version` methods will help to ease the process of potentially
merging them into one method in the future.
2022-09-27 00:27:26 -04:00
Sam Ford
7ffeba6380
Convert some multiline code into a single line
Using a multiline format in these areas isn't necessary and we can
clean up these lines by converting them to a single line format.
2022-09-27 00:21:18 -04:00
Sam Ford
40b0070beb
Modify comments and other text
The `check_for_resources` code arguably speaks for itself, so it
doesn't feel like a necessary addition. Besides that, this cleans up
some other comments and text to better align with existing examples.
2022-09-27 00:18:20 -04:00
Mohammad Zain Abbas
e3cab15e93 Set Homebrew.failed = true to get correct status code 2022-09-26 19:37:46 +02:00
Mohammad Zain Abbas
e26da060f0 Merge branch 'mohammad' of https://github.com/mohammadzainabbas/brew into mohammad 2022-09-25 20:48:45 +02:00
Mohammad Zain Abbas
ae031041a2 Refactored code 2022-09-25 20:48:44 +02:00
Mohammad Zain Abbas
2f74eb5b5b
Update Library/Homebrew/livecheck/livecheck.rb
Co-authored-by: Sam Ford <1584702+samford@users.noreply.github.com>
2022-09-25 22:21:04 +05:00
Mohammad Zain Abbas
6d993fa642 Fixed minor issues and applied suggestions 2022-09-25 00:53:44 +02:00
Mohammad Zain Abbas
560680bfa3 Minor fix for brew typecheck 2022-09-18 21:36:22 +02:00
Mohammad Zain Abbas
ee1210a495 Fixed style and typecheck issues 2022-09-18 21:27:10 +02:00
Mohammad Zain Abbas
980538b8b2 Exclude :meta info for resources if latest.blank? for Formula 2022-09-18 17:29:44 +02:00
Mohammad Zain Abbas
3d9c6ddb75 Minor fix: return error when resource_version method returns empty hash 2022-09-18 17:09:21 +02:00
Mohammad Zain Abbas
f8ef7bd0e9 Minor fixes 2022-09-14 06:05:43 +02:00
Mohammad Zain Abbas
c06b80c2ca After brew style --fix 2022-09-14 04:59:01 +02:00
Mohammad Zain Abbas
7a627565ac Fixed output issue 2022-09-14 04:54:52 +02:00
Mohammad Zain Abbas
990f71367b Refactoring resource_version to always return hash info 2022-08-23 16:08:18 +02:00
Mohammad Zain Abbas
9377346bdf Minor fixes 2022-08-17 17:41:34 +02:00
Mohammad Zain Abbas
2ae583c836 Removed resource_name method 2022-08-11 21:50:54 +02:00
Mohammad Zain Abbas
54c9338ed4 Removed use_homebrew_curl? for resources 2022-08-11 21:25:24 +02:00
Mohammad Zain Abbas
c111a5bc9d Revert back changes + modified resource_name method 2022-08-11 21:00:28 +02:00
Mohammad Zain Abbas
f9f3d3d84b Minor refractoring 2022-08-10 22:00:08 +02:00