241 Commits

Author SHA1 Message Date
Eric Knibbe
3dc9e88542
parser: show related env var in switch description 2025-06-03 13:57:42 -04:00
Eric Knibbe
29b2f35ce8
docs: prefer /opt/homebrew in examples 2025-02-03 15:30:03 +01:00
Mike McQuaid
7ff99e2353
Use ~ instead of ${HOME}
Partial revert of Homebrew/brew#19153
See https://github.com/Homebrew/brew/pull/19153#discussion_r1930678587
2025-01-27 15:19:59 +00:00
Issy Long
45978435e7
rubocop: Use Sorbet/StrictSigil as it's better than comments
- Previously I thought that comments were fine to discourage people from
  wasting their time trying to bump things that used `undef` that Sorbet
  didn't support. But RuboCop is better at this since it'll complain if
  the comments are unnecessary.

- Suggested in https://github.com/Homebrew/brew/pull/18018#issuecomment-2283369501.

- I've gone for a mixture of `rubocop:disable` for the files that can't
  be `typed: strict` (use of undef, required before everything else, etc)
  and `rubocop:todo` for everything else that should be tried to make
  strictly typed. There's no functional difference between the two as
  `rubocop:todo` is `rubocop:disable` with a different name.

- And I entirely disabled the cop for the docs/ directory since
  `typed: strict` isn't going to gain us anything for some Markdown
  linting config files.

- This means that now it's easier to track what needs to be done rather
  than relying on checklists of files in our big Sorbet issue:

```shell
$ git grep 'typed: true # rubocop:todo Sorbet/StrictSigil' | wc -l
    268
```

- And this is confirmed working for new files:

```shell
$ git status
On branch use-rubocop-for-sorbet-strict-sigils
Untracked files:
  (use "git add <file>..." to include in what will be committed)
        Library/Homebrew/bad.rb
        Library/Homebrew/good.rb

nothing added to commit but untracked files present (use "git add" to track)

$ brew style
Offenses:

bad.rb:1:1: C: Sorbet/StrictSigil: Sorbet sigil should be at least strict got true.
^^^^^^^^^^^^^

1340 files inspected, 1 offense detected
```
2024-08-12 15:24:27 +01:00
Mike McQuaid
6e9288470e
brew style --fix 2024-05-23 17:15:43 +01:00
Markus Reiter
0f0055ede4
Make documentation @api private by default. 2024-04-26 19:04:20 +02:00
Bo Anderson
754d580a91
Replace ronn with Kramdown's converter 2024-03-10 22:31:38 +00:00
Mike McQuaid
10c47af8c7
manpage: note env files do not support expansion.
Fixes #16027
2023-09-26 13:09:46 +01:00
Eric Knibbe
569c833924
Formula-Cookbook: expand terminology table 2023-08-12 21:48:16 -04:00
Mike McQuaid
375a7ee8dc
Allow configuring Homebrew with .env files
For a long time people have requested some sort of configuration files
for Homebrew. Now: here's the first version of that.

Similarly to how you can configure Git for a system, a repository or
a user: you can configure Homebrew for a system, a prefix or a user.

The system-wide configuration file is `/etc/homebrew/brew.env`, the
prefix-specific configuration file is
`$HOMEBREW_PREFIX/etc/homebrew/brew.env`
and the user-specific configuration file is `~/.homebrew/brew.env`.

As we need to read these files from Bash in `bin/brew` (so they can)
influence functionality ASAP: they are in a simple format that Bash
can read. It may be that we have more complex array or hash data in
future that's configured through JSON or YAML (most likely JSON as we
use it more) and stored in a `brew.json`/`brew.yaml` file in the same
directory.

As this is relying on `eval` in Bash which is fairly dangerous: we
filter the lines with a regex to ensure we're only permitting setting
`HOMEBREW_*` variables and nothing more.

To give a bit of power to system administrators, the
`HOMEBREW_SYSTEM_ENV_TAKES_PRIORITY` variable can be set in
`/etc/homebrew/brew.env` to ensure that the system-wide configuration
file is loaded last and overrides any prefix or user settings.

Now that we have an actual location for configuration files, let's also
change the `brew livecheck` watchlist configuration file to be in this
directory and deprecate the existing location. As this is a developer
command and the mitigation is to just move the file: we don't need to
follow the normal deprecation process here.
2023-07-28 17:17:14 +01:00
EricFromCanada
0d2b74d7e7
docs: add missing template file edits
plus extra instructions for completions file editing
2023-02-19 16:22:39 -05:00
Rylan Polster
a17f41680d
Combine Linux and macOS maintainers on the README 2022-01-21 12:05:18 -05:00
Mike McQuaid
11c5f8f05a
Improve discovery of some environment variables
There's a few bits of functionality that Homebrew has changed over the
years, makes sense as a sensible default but some people find really
annoying:

- automatically running `brew update`
- automatically running `brew cleanup`
- automatically upgrading outdated dependents
- automatically reinstalling broken dependents

For each of these: let's improve the documentation of the commands
whose behaviour is changed and the environment variables themselves.
2021-11-25 09:10:59 +00:00
Rylan Polster
45f23d4c16
docs: improve terminology guide from code review
Co-Authored-By: Mike McQuaid <mike@mikemcquaid.com>
2021-06-08 10:45:03 -04:00
Rylan Polster
2c22a258a0
docs: Separate terminology from cookbook and manpages 2021-06-07 10:58:14 -04:00
Rylan Polster
144c1c68c3
docs: add terminology to manpage 2021-06-05 14:49:51 -04:00
Nanda H Krishna
b9b83edc1a
dev-cmd: rename brew man to brew generate-man-completions 2021-05-04 18:32:42 +05:30
EricFromCanada
6fc116318e fixes for grammar and wording 2021-01-26 16:19:47 -05:00
Tom
989dc3e10b manpage: Recommend using ./ for local file formulae 2020-11-21 12:39:28 +00:00
EricFromCanada
72bc057014 manpage: fixes for formatting 2020-11-16 08:02:50 -05:00
EricFromCanada
19f3acea41 manpage: update instructions & description in template file 2020-11-16 07:56:50 -05:00
Markus Reiter
7743fed77b Add “GLOBAL CASK OPTIONS” section to man page. 2020-10-08 11:07:35 +02:00
Markus Reiter
1f9130e070 Remove references to brew-cask from brew man page. 2020-08-14 05:35:34 +02:00
Markus Reiter
b48bc316e0 Use CLI::Parser for cask commands. 2020-08-13 05:15:15 +02:00
Mike McQuaid
9a654897d4
manpage: no longer mention installing from a URL.
This is deprecated in #7660.
2020-05-29 17:04:42 +01:00
Shaun Jackman
133ee7966d shell: Use .profile unless .bash_profile exists 2020-05-13 09:30:02 -07:00
EricFromCanada
9d6eb41fc5 cmd/dev-cmd: misc. usage and wording fixes 2020-04-19 13:31:54 -04:00
Mike McQuaid
ad75e40ce7
man: generate from Homebrew::EnvConfig. 2020-04-07 09:58:26 +01:00
Vítor Galvão
2e8aa3eb97 Use long --disable instead of short -q in curl 2020-03-29 20:04:37 +01:00
Markus Reiter
50b61fa7f2 Retry curl requests 3 times by default. 2020-03-20 18:40:43 +01:00
Mike McQuaid
2afeffc91b
man: include full help from external commands.
Inspired by https://github.com/Homebrew/brew/issues/7148
2020-03-11 12:22:46 +00:00
Mike McQuaid
cfe2f5bfda
Merge remote-tracking branch 'origin/master' into add_change_origin_command 2019-12-30 10:39:28 +00:00
Mike McQuaid
355626ac51
Tweak/fix Git remote configuration behaviour. 2019-12-30 10:38:47 +00:00
Issy Long
8740d4947e
Title Case the heading in the brew(1) man page template
- Without this, `brew man` produces a lowercasing diff that violates
  Vale's rules.
- Also run `brew man` to test this out, and that updated some dates to
  December.
2019-12-18 16:09:29 +00:00
Mike McQuaid
8ff2e9ae4e
Improve speed of HOMEBREW_AUTO_UPDATE_SECS
This variable allows a user to configure how often `brew update` runs.
With the previous implementation, however, it was still pretty slow as
it would run some of `brew update` even within the timeout. This feels
related to complaints about Homebrew "feeling slow" since we enabled
this. Address this by:

- making `HOMEBREW_AUTO_UPDATE_SECS` behave more like
  `HOMEBREW_NO_AUTO_UPDATE` and entirely skip the invocation of
  `brew update` if the relevant tap (homebrew-core or homebrew-cask
  depending on command invoked) has been checked in the last
  `HOMEBREW_AUTO_UPDATE_SECS`
- Only require/check the update of a single tap rather than every tap
- Increase the default value of `HOMEBREW_AUTO_UPDATE_SECS` from 1m
  to 5m to cut people a bit more slack. We're not updating things
  often enough for 1m not to feel a bit overkill and 5m feels
  appropriate for a Homebrew "session" to only require a single update.
2019-10-03 12:54:34 +01:00
Dawid Dziurla
25454a9257
cat: look for HOMEBREW_BAT 2019-10-02 21:59:45 +02:00
EricFromCanada
20e3edfc78 manpages: add link to API & regenerate 2019-08-20 09:13:28 -04:00
EricFromCanada
8a8359cdd4 manpages: sentence rewording for readability
Use active voice when applicable, better verbs & adjectives, preposition usage, proper tense, etc.
2019-08-20 09:05:45 -04:00
EricFromCanada
b4303cd983 manpages: fix command & option descriptions 2019-08-20 09:03:33 -04:00
EricFromCanada
329c6c78be manpages: relocate some sections
Reorder switches as force/quiet/verbose/debug, --installed before --all, and link to SPECIFYING FORMULAE from top of page.
2019-08-20 08:58:20 -04:00
EricFromCanada
6340792f78 manpages: output formatting fixes 2019-08-20 08:28:35 -04:00
EricFromCanada
a3e0647797 manpages: whitespace fixes 2019-08-20 08:24:20 -04:00
Mike McQuaid
1cd45a769d
Merge pull request #6330 from hogand/add-upgrade-dry-run
Add --dry-run to brew upgrade and brew cask upgrade
2019-07-28 15:18:13 +01:00
Mike McQuaid
9354081323
Add HOMEBREW_DISPLAY_INSTALL_TIMES
Fixes #6300
2019-07-28 11:12:32 +01:00
Doug Hogan
ac0ff9ae46 Update md and run brew man. 2019-07-27 07:03:42 -07:00
Cheng XU
ebec9d35d9
manpages: add brew cask --cache command 2019-05-23 15:28:00 +08:00
Maik Riechert
e113fd70be add HOMEBREW_CURL_RETRIES 2019-05-18 13:23:08 +01:00
Mike McQuaid
09d8f6485c
manpage: tweak HOMEBREW_ARCH wording. 2019-05-07 08:33:44 +01:00
dalance
9d4e1a53f5 Add doc of HOMEBREW_ARCH 2019-05-07 11:50:14 +09:00
Vítor Galvão
82d480eddd cask manpages: update homepage to brew.sh 2019-04-13 19:47:53 +01:00