43 Commits

Author SHA1 Message Date
Issy Long
b6fbd51f0e
Use Pathname#read again but with force_encoding
Co-authored-by: Carlo Cabrera <30379873+carlocab@users.noreply.github.com>
2024-08-10 17:24:05 +01:00
Issy Long
4bfbc6a4ff
readall: Bump to Sorbet typed: strict 2024-08-10 16:43:32 +01:00
Markus Reiter
0f0055ede4
Make documentation @api private by default. 2024-04-26 19:04:20 +02:00
Mike McQuaid
ea2892f8ee
brew.rb: handle missing args. 2024-03-07 16:20:20 +00:00
apainintheneck
bea2dc65fe Clean up files that use to include cachable
These were changed to extend to make it easier to determine
where the classes come to in the extended callback but that
means that the file is somewhat inconsistent. On the one
hand we're using class methods and on the other we're extend
self. This cleans that up but now the diff is atrocious and
the blame is even worse. Oh well...
2024-02-26 21:21:38 -08:00
apainintheneck
536ae08a44 cachable: make sure to clear caches between tests
This adds a registry for all modules and classes that
cachable is included in. The registry allows us to
programmatically clear all caches in between tests
so that we don't forget to do that when adding a new
class or refactoring code. The goal here is to reduce
the number of flaky tests in the future.
2024-02-25 17:47:30 -08:00
Douglas Eichelberger
eb7c3e52a0 Require SystemInclude only where needed 2024-01-31 11:42:01 -08:00
Issy Long
f682147598
Fix RuboCop Style/RedundantFreeze offenses 2024-01-18 22:20:01 +00:00
Rylan Polster
b7532a86e1
Add commented out deprecations for MacOS when simulating Linux 2023-11-22 21:22:00 -05:00
Bo Anderson
9bd8087982
readall: check hash generation works 2023-09-28 14:51:45 +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
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
Markus Reiter
d55f1b85bf
Add --os and --arch flags to readall. 2023-05-20 20:11:31 +02:00
Markus Reiter
0d56b97b07
Add SimulateSystem::with. 2023-05-14 01:45:04 +02:00
Markus Reiter
8274920217
Rename OS::Mac::Version to MacOSVersion. 2023-05-09 05:08:38 +02:00
apainintheneck
0048b394d4 readall: fix no simulate
This wasn't working with casks because the bottle tag
would be nil here.

It was refactored to not use the bottle tag because
casks don't have bottles.

I also moved the valid_casks? method to extend/os/mac
because casks only run on macOS and the generic OS
tests were failing before.
2023-03-26 10:37:20 -07:00
Markus Reiter
5e52d415a9
Allow fetching for different arch. 2023-03-25 11:56:09 +01:00
Issy Long
6d822d9a62
rubocop: Drop "fn" from Naming/MethodParameterName allowlist
- I originally thought this was short for "function", but upon closer
  inspection all its usages are to do with filenames. So, use "filename",
  it's clearer.
2023-03-08 14:40:56 +00:00
Bo Anderson
09dbe9f86e
readall: reject casks with no URL 2023-02-24 18:07:19 +00:00
Rylan Polster
174087958b
Simulate all OS/arch combinations in brew readall 2022-10-10 23:56:37 -04:00
Mike McQuaid
e2759fbdff
Deprecate reading all formulae through commands
We added the `--all` flag (now renamed to `--eval-all`) for various
commands for this behaviour so let's start deprecating this.

Also, introduce a `HOMEBREW_EVAL_ALL` environment variable to use the
existing, less secure, behaviour by default and avoid passing
`--eval-all` everywhere.
2022-09-05 13:57:22 +01:00
Markus Reiter
6750448d95 Fix some auto-correctable type errors. 2020-11-29 21:23:54 +01:00
Markus Reiter
24ae318a3d Move type annotations into files. 2020-10-10 14:59:39 +02:00
Markus Reiter
f55debaeed Document Readall. 2020-08-26 03:13:59 +02:00
Sean Molenaar
3f6d3e5cf0
Support casks in readall 2020-06-18 20:15:07 +02: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
7fbfb02625
Remove usage of Thread.new
I benchmarked these both locally and neither use of `Thread.new`
provides any measurable speedup (and in the `readall` case appears to
slow things down) on my 8 core machine.
2019-04-18 14:46:40 +09:00
Markus Reiter
32ad22395b Remove some #popen_reads. 2018-09-04 05:16:59 +02:00
Markus Reiter
fd2a333b45 Use grep_v. 2018-07-22 21:11:47 +02:00
Markus Reiter
28384ba518 Rename Hbc::SystemCommand to SystemCommand. 2018-07-22 21:11:47 +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
Markus Reiter
b63a5cbd4b Don't require "thread". 2017-10-24 19:39:40 +02:00
Markus Reiter
175ca909ee Clean up code style and remove .rubocop_todo.yml. 2017-10-08 16:10:37 +02:00
Mike McQuaid
021cef4b2b Autocorrect Rubocop Style/SpecialGlobalVars. 2017-06-12 09:11:42 +01:00
Mike McQuaid
e8ef50d075 readall: fix tapping taps without aliases.
Fixes https://github.com/caskroom/homebrew-cask/issues/32840.
Fixes https://github.com/Homebrew/brew/issues/2529.
2017-04-22 21:43:45 +01:00
Mike McQuaid
cd5924950e readall: check for shadowed aliases.
If an alias has the same name as a formula then weirdness will result
so ensure this causes `readall` to fail.
2017-04-22 17:08:36 +01:00
ilovezfs
b59bf2ff64 Revert "audit: check for version aliases." 2017-02-21 11:31:18 -08:00
Mike McQuaid
68bd744d0e readall: check for shadowed aliases.
This will become particularly relevant when there’s a new version of a
formula and the existing alias needs to be removed.
2017-02-21 15:36:50 +00:00
Maxim Belkin
9a0127e7ab readall: do not require itself. 2016-09-21 11:45:47 -05:00
Markus Reiter
7b8bae710e Use ThreadError to break loop. 2016-08-22 08:57:47 +02:00
Mike McQuaid
4da990587f tap: run readall when tapping. (#396)
* readall: move readall logic to new class.

* tap: run readall when tapping.

This will prevent tapping an tap with syntax errors from causing issues
for users.

Fixes #58.
2016-07-09 13:51:19 +01:00