91 Commits

Author SHA1 Message Date
Dawid Dziurla
0d0c98de29
Allow defining service run command per platform 2023-01-19 11:36:37 +01:00
Sean Molenaar
0cd10ed65e
caveats: print sudo in caveats if service requires it 2022-12-05 12:12:51 +01:00
Issy Long
b7d997e80d
sorbet: Bump some files from typed: false to typed: true
- This was done with `brew typecheck --update --suggest-typed` which
  (as of the previous commit) uses Spoom, yet another gem. I thought I'd
  see how well it works. There are no Sorbet errors after these changes!
2022-10-11 01:09:03 +01:00
Bo Anderson
02164a35db
Use ORIGINAL_PATHS over envs; reject nil PATH 2022-06-17 19:47:57 +01:00
Sean Molenaar
73bc934c85
Caveats: suggest brew services for linux 2021-10-30 18:18:25 +02:00
Sean Molenaar
ef9c49c5b2
service: ensure environment variables are prefixed in command 2021-05-25 11:47:44 +02:00
Sean Molenaar
3ab21cc412
services: replace plist_options :manual with service command 2021-05-01 16:20:47 +02:00
EricFromCanada
6fc116318e fixes for grammar and wording 2021-01-26 16:19:47 -05:00
Seeker
b9854bd4cf rubocops: add unless_multiple_conditions 2021-01-08 10:33:54 -08:00
Mike McQuaid
1f8fd2a9ef
caveats: remove ZSH FPATH logic.
This is too error-prone and full of edge cases.

Fixes #9455
2020-12-09 11:47:48 +00:00
Mike McQuaid
ac84a4b051
Fix ZSH FPATH handling
Don't require it to be exported but shell out to `zsh` instead.

Fixes https://github.com/Homebrew/brew/issues/9387
2020-12-03 16:52:55 +00:00
Mike McQuaid
3002c810be
Improve ZSH completions handling
- Only display the completions caveats from the current shell (assuming
  it's one of Bash, ZSH or Fish)
- If the completions location isn't in the ZSH `FPATH` then link to the
  documentation explaining how to do so.

Fixes https://github.com/Homebrew/brew/issues/8984
2020-11-26 16:08:26 +00:00
Markus Reiter
24ae318a3d Move type annotations into files. 2020-10-10 14:59:39 +02:00
Markus Reiter
8957422d86 Document Caveats. 2020-08-26 03:13:58 +02:00
Mike McQuaid
3a91c37e66
Fix RuboCop checks. 2020-08-19 17:12:32 +01: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
fc6bd2ea1c
Fixup more frozen string handling. 2019-04-20 14:07:29 +09:00
Mike McQuaid
36dbad3922
Add frozen_string_literal to all files. 2019-04-20 13:27:36 +09:00
Mike McQuaid
2e7a3f3da2
caveats: tweak wording/formatting. 2019-03-13 08:56:16 +00:00
Morgan Tocker
a1f24748e6 caveats: non-macOS platforms warn on services
Only currently supported by macOS. Attempting to use services
should produce a warning for now.  It is possible it might be
supported in the future.
2019-03-12 13:47:54 -06:00
Mike McQuaid
d64429a736
rubocop: enable Style/IfUnlessModifier. 2019-02-21 12:55:49 +00:00
Mike McQuaid
b89367e6d9 caveats: tweak keg_only_text
- make it a public method
- allow skipping the reason
- output how to set the various variables in your current shell
2018-07-26 10:49:07 +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
36dadbee47 caveats: remove python caveats.
These instructions are currently incorrect and need to be ported to
`python` 3.x and `python@2` formulae. Until then it's better to not have
them than have them be incorrect.

Closes #3890.
2018-03-08 08:34:20 +00:00
Mike McQuaid
d54e670a64 requirements: move more to compat. 2017-12-30 20:56:55 +00:00
Mike McQuaid
cacefb2b99
caveats: tweak root_dir definition style. 2017-12-24 07:59:17 +00:00
Dominyk Tiller
92e62ba583
caveats: correct completion/function paths for keg_only 2017-12-23 23:15:59 +00:00
Dominyk Tiller
55d9750056
caveats: fix fish caveats under env filtering 2017-12-11 09:16:39 +00:00
Dominyk Tiller
d70a406fe7
caveats: fix PKG_CONFIG_PATH nudge under env filtering 2017-12-11 06:26:56 +00:00
Markus Reiter
0ea855c6e6 Add missing require "forwardable". 2017-10-24 19:39:40 +02:00
Markus Reiter
9bee9ca575 Use “squiggly” heredocs. 2017-10-18 14:39:09 +02:00
Maxim Belkin
336fbb5db2
caveats: making plist_caveats macOS-only 2017-10-16 11:15:54 -05:00
Mike McQuaid
01e9ec9a9f Rubocop: automatic rule fixes. 2017-09-24 21:23:59 +01:00
Misty De Meo
2bd8091ae8 Merge pull request #2804 from mansimarkaur/caveats
Increasing test coverage for caveats.rb
2017-07-25 09:28:46 -07:00
mansimarkaur
ae02b9776a Added tests for python caveats 2017-07-25 21:00:37 +05:30
mansimarkaur
9218d3014d Added tests for plist_caveats 2017-07-25 21:00:26 +05:30
mansimarkaur
5fba0c4776 Added tests for function_completion_caveats 2017-07-25 21:00:04 +05:30
Markus Reiter
3b4ee58c49 Refactor using Forwardable and DelegateClass. 2017-06-28 09:25:31 +02:00
Dominyk Tiller
c081b3d975
caveats: chomp keg_only reason 2017-05-02 19:03:03 +01:00
Dominyk Tiller
285b0bc941
caveats: tweak keg_only wording
Current:
```
This formula is keg-only, which means it was not symlinked into /usr/local.

Qt has CMake issues when linked
```

After:
```
This formula is keg-only, which means it was not symlinked into /usr/local,
because Qt has CMake issues when linked.
```
2017-05-01 16:56:16 +01:00
Mike McQuaid
ba3c46d24f More deprecations.
Deprecate more methods. Internal APIs have been verified to be unused
elsewhere and removed. External APIs have had deprecation methods added.
Existing deprecations have been either upgraded to produce warnings or
no longer deprecated and the reasoning documented.
2017-04-22 16:28:07 +01:00
Alex Dunn
00af5250f0 caveats: combine completion and function messages
Fixes https://github.com/Homebrew/homebrew-core/issues/10338.

Closes #2287.

Signed-off-by: Alex Dunn <dunn.alex@gmail.com>
2017-03-19 16:32:23 -07:00
Mike McQuaid
7a2c5c0f2f caveats: add newline after keg only reason. 2017-01-26 15:18:32 +00:00
Mike McQuaid
cc22239c99 caveats: tweak keg-only messaging.
Slim down the existing text and make it more obvious what's happening.
Note specifically how to add it to your PATH to convince people to try
that instead of `brew link --force`.
2017-01-25 08:25:16 +00:00
Mike McQuaid
c0a29d6644 caveats, keg: remove linkapps caveats code. 2017-01-09 14:10:26 +00:00
Zach Whaley
14f46625a3 caveats: Differentiate zsh completion files and function files
When installing a file to zsh/site-functions directory, it is assumed this is a zsh completion file,
and the zsh completion caveat is printed after installation.

But not all files in the zsh/site-functions directory are completion files.
Some are files for functions that can be loaded on demand with zsh's autoload command.

- Edit Keg.completion_installed to search specifically for files in the zsh/site-functions
  directory starting with an underscore only (By convention, zsh completion files start with an underscore)
- Add Keg.zsh_functions_installed to search for non-completion files in the zsh/site-functions
- Add Caveats.zsh_function_caveats to print a caveat if non-completion files have been installed
  to zsh/site-functions
2016-12-08 07:23:26 -06:00
Zach Whaley
1995f65308 Add a method for installing fish function files
Fish shell allows third-party software vendors to put their own function files in a directory for their software.
For brew installed Fish shell, this is /usr/local/share/fish/vendor_functions.d
2016-12-04 13:21:42 -06:00
Markus Reiter
a5b11a6a5c Fix Style/GuardClause. 2016-09-23 15:30:07 +02:00
Mike McQuaid
6693915399 rubocop --auto-correct all remaining files.
But remove some manual `.freeze`s on constants that shouldn't be
constants.
2016-09-17 16:14:13 +01:00
Dominyk Tiller
2394d6f2d8
caveats: highlight PKG_CONFIG_PATH if exists
We keep getting issues every now & again about people being confused that
keg_only includes hiding the `pkg-config` files. Perhaps seems reasonable to
start pointing out those exist when they do & a hint on how to access them.

Hidden behind a which check to avoid redundant messages, although `pkg-config`
is an incredibly popular formula. Ran some time tests, no appreciable difference
from the status quo.

If accepted:
Closes https://github.com/Homebrew/homebrew-core/issues/4669.
2016-09-11 04:49:09 +01:00