74 Commits

Author SHA1 Message Date
Douglas Eichelberger
b90897e280 Create git_repo attr 2023-04-15 19:35:13 -07:00
Douglas Eichelberger
8307255ce8 Update call sites 2023-04-15 19:35:13 -07:00
Douglas Eichelberger
429f23dcc6 Create GitRepoPath 2023-04-15 19:35:12 -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
Mike McQuaid
c209c0403d
Fix references to formula.json and cask.json
These would be stranded after `formula.jws.json`.
2023-02-24 16:46:15 +00:00
Rylan Polster
672b8c036d
Fix error when showing brew config JSON update time 2023-02-05 16:07:00 +01:00
Mike McQuaid
fd18c7b0ac
Tweak cask-source API handling
- Use raw.githubusercontent.com to download cask source rather than
  formulae.brew.sh. This allows us to remove these files
- output the tap's current `HEAD` for both formulae and cask JSON
- use this `HEAD` for the cask-source API to get the exact file on
  raw.githubusercontent.com rather than just whatever is newest (which
  is what the previous API did)
- set the `Tap` correctly when creating a `Cask` from the API
- if the `formula.json` file exists: print its modified time include
  `brew config`
- memoize `tap.git_head` as we'll be calling it a lot in the same
  process with the same value
2023-01-26 17:36:40 +00:00
Mike McQuaid
1b75348ed4
Revert "show/check Homebrew branch" 2023-01-18 13:59:58 +00:00
Adrian Ho
c0331c9142 show/check Homebrew branch
Because anyone can forget they're on a different branch, and wonder
why `brew update` isn't pulling in the latest changes (https://github.com/orgs/Homebrew/discussions/4105#discussioncomment-4658869).
2023-01-12 18:20:47 +08:00
Carlo Cabrera
25fe428ed2
system_config: fix clang version output on Linux
If you have Homebrew LLVM installed, `brew config` will show

    Clang: 12.0.1 build (parse error)

because Homebrew LLVM does not give a build number. Some installations
from the system package manager do have this information, so let's show
it if it's available but skip complaining if not.

I've kept the original code for macOS because we always expect Apple's
build number to show there.
2021-10-07 11:24:20 +08:00
Carlo Cabrera
7dabb465b3
system_config: don't print path to curl shim
See discussion at #12191.
2021-10-06 23:58:04 +08:00
Bo Anderson
a06d136d2c
Move Sorbet gems into an optional group 2021-06-11 08:10:30 +01:00
Bo Anderson
8ff7b58cba system_config: remove describe_java 2021-02-09 20:58:30 +00:00
Markus Reiter
da9289eff0 Add more type signatures. 2020-11-13 12:26:36 +01:00
Markus Reiter
61b79318ed Move include Kernel into .rbi files again and split up existing .rbi files. 2020-10-10 19:10:58 +02:00
Markus Reiter
24ae318a3d Move type annotations into files. 2020-10-10 14:59:39 +02:00
Maxim Belkin
2c5eec509b system_config.rb: refactor code into worker functions
Break down `dump_verbose_config` function into "worker" functions that
display information for specific categories:

- `core_tap_config` for Core tap info
- `homebrew_config` for Homebrew/brew info
- `homebrew_env_config` for environment-related information
- `host_software_config` for Host software

Also, factor out code related to Clang into `describe_clang` function,
so that we can do:

```
f.puts "Clang: #{describe_clang}"
```
2020-09-04 18:27:12 +00:00
Mike McQuaid
8b97c27c21 brew style manual fixes 2020-09-01 14:26:45 +01:00
Markus Reiter
3118fedab9 Refactor and document Git. 2020-08-23 06:40:07 +02:00
Markus Reiter
e2c9e6d3c2 Refactor and document SystemConfig. 2020-08-23 04:15:35 +02:00
Bo Anderson
30a8df0f91 os/mac/system_config: simplify JVM version parsing 2020-08-11 18:51:36 +01:00
Dustin Rodrigues
ad29ee4550 config: include core branch in output 2020-08-02 00:09:52 -04:00
Mike McQuaid
aa81982aba
brew style --fix 2020-06-02 09:49:23 +01:00
Mike McQuaid
3381cbf5c7
Use Homebrew::EnvConfig. 2020-04-07 09:58:26 +01:00
Mike McQuaid
5f9c98176c
system_config: ignore HOMEBREW_*_GIT_REMOTE.
These aren't interesting enough to show in `brew config` as they
duplicate other data already displayed.
2020-01-18 14:25:38 +00:00
Cheng XU
66697d4290
ENV: add sensitive_environment function
ENV#sensitive_environment is used to list all sensitive environments.

Also refactor the code on determining whether an environment is sensitive.
2019-07-18 15:06:33 +08:00
Mike McQuaid
7c04c34a88
system_config: hide HOMEBREW_BUNDLE_* env vars.
These are being introduced in e.g.
https://github.com/Homebrew/homebrew-bundle/pull/486 and we don't care
about them in Homebrew bug reports.
2019-06-12 12:43:44 +01:00
Mike McQuaid
6b2dbbc96f
Merge pull request #6042 from MikeMcQuaid/boring_homebrew_display
config: don't show HOMEBREW_DISPLAY.
2019-04-22 13:07:20 -07:00
Mike McQuaid
58e57f2d49
config: don't show HOMEBREW_DISPLAY.
This is set by XQuartz and not needed information for us.
2019-04-20 16:22:10 +09:00
Mike McQuaid
36dbad3922
Add frozen_string_literal to all files. 2019-04-20 13:27:36 +09:00
Mike McQuaid
b03558e296
system_config: don’t output default HOMEBREW_LOGS.
This cuts down a bit on noise. While we’re here, optimise the checks too.
2019-04-17 17:02:33 +09:00
Mike McQuaid
d64429a736
rubocop: enable Style/IfUnlessModifier. 2019-02-21 12:55:49 +00:00
Mike McQuaid
737b84b54b
brew style --fix fixes. 2018-11-02 17:29:23 +00:00
EricFromCanada
0362e66a26 doctor: use minimum Git version set in brew.sh 2018-10-28 20:13:19 -04:00
EricFromCanada
7c9bea2703 system_config: skip HOMEBREW_GIT as its final path is shown further down 2018-10-26 23:47:59 -04:00
Mike McQuaid
78ddc34847
config: hide optional system packages.
Java, XQuartz and the CLT separate header package aren't required for
everyone's Homebrew usage or a default macOS development install.

As a result, only show then in `brew config` when they are actually
installed.
2018-09-30 10:50:37 +01:00
Mike McQuaid
5ac056fa52
system_config: don't print default HOMEBREW_GIT value.
This is `git` for most people.
2018-09-23 19:43:30 +01:00
commitay
2cb253520e system_config: add HOMEBREW_MACOS_VERSION_NUMERIC to boring_keys 2018-09-23 12:59:03 +10:00
Markus Reiter
e9b9ea49a1 Update to RuboCop 0.59.1. 2018-09-17 03:45:59 +02:00
Shaun Jackman
3c4f9c746e Elide prefix "/usr/local" in bottle block
brew test-bot --ci-upload is run on a Linux machine.
The macOS bottles have a prefix of "/usr/local".
The default prefix on Linux is /home/linuxbrew/.linuxbrew.
Elide prefix "/usr/local" in the bottle block, even it does not match
the default prefix. Ditto for cellar.
2018-09-11 14:21:33 -07:00
Shaun Jackman
f6093961ef Add Homebrew::DEFAULT_PREFIX for Linux
The default prefix is /usr/local on macOS
and /home/linuxbrew/.linuxbrew on Linux.
2018-09-11 09:57:08 -07:00
Markus Reiter
32ad22395b Remove some #popen_reads. 2018-09-04 05:16:59 +02:00
Mike McQuaid
f46e4596c0 Cleanup HOMEBREW_TEMP handling
- Ensure that `HOMEBREW_TEMP` is only displayed in `brew config` when
  it's non-default.
- Attempt to create a missing `HOMEBREW_TEMP` directory rather than
  failing to `realpath`. Note this will still fail on permissions errors
  which is to be expected.
2018-07-03 15:41:33 +01:00
Mike McQuaid
facd76bc51 portable-ruby: respect HOMEBREW_BOTTLE_DOMAIN variable.
This was requested in:
https://discourse.brew.sh/t/adding-additional-download-sources-to-homebrew/2446

With this change you can use e.g. Artifactory for Homebrew's portable
ruby.
2018-06-29 19:51:18 +01: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
9b1bd5f45a system_config: don’t output std/superenv vars. 2018-04-02 09:40:39 +01:00
Mike McQuaid
7095738d1d Remove config/doctor checks we no longer need
A bunch of these were needed before superenv, environment filtering or
on now long-unsupported versions of macOS.
2018-04-02 09:40:39 +01:00
Mike McQuaid
11f315834e system_config: never display default_hash keys.
Otherwise you can end up with duplicate outputs.
2018-03-25 09:43:39 +01:00
Mike McQuaid
fce9d520e7 system_config: don't output HOMEBREW_RUBY_WARNINGS
It's set by default and the output is pretty obvious if changed.
2018-03-22 22:04:31 +00:00
Mike McQuaid
fc7fb60b72
system_config: use some puts for clang. 2018-03-22 08:26:26 +00:00