36 Commits

Author SHA1 Message Date
botantony
d15461608f
fix: prevent Zsh crashes related to autocompletion
Signed-off-by: botantony <antonsm21@gmail.com>
2025-04-22 22:02:38 +02:00
Jamin Thornsberry
c5253b23c2 Remove fish command completions for excluded commands
This removes fish command completions (but keeps argument completions)
for commands in the `COMPLETIONS_EXCLUSION_LIST` list.

It also removes unnecessary exclusions of `*instal` aliases in command
suggestions in bash and fish completions, since those were removed from
`internal_commands_list.txt` in Homebrew#10229. This makes
`COMPLETIONS_EXCLUSION_LIST` the single source of truth for commands to
exclude from completions.
2024-11-20 17:35:42 -06:00
Michael Cho
910a5c3d3f
completions: fix short option conflict in zsh completion 2024-09-27 12:22:30 -04:00
Michael Cho
0029308844
completions: typed: strict 2024-09-26 14:32:40 -04: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
Markus Reiter
0f0055ede4
Make documentation @api private by default. 2024-04-26 19:04:20 +02:00
apainintheneck
fb8c0d2b30 s/Tap.select(&:installed?)/Tap.installed/ 2024-03-08 23:22:00 -08:00
Issy Long
f4218a6316
Fix RuboCop Performance/MapCompact offenses
- Rename an iterator variable since it would make the line too long.
2024-02-25 22:59:59 +00:00
Markus Reiter
ab27efbd9d
Make Tap::each respect the API. 2024-02-22 17:56:47 +01:00
Douglas Eichelberger
b3522b3bb8 Remove ActiveSupport String filters 2024-01-02 16:56:27 -08:00
Douglas Eichelberger
24cf6076e8 brew style --fix 2023-04-24 20:42:39 -07:00
Douglas Eichelberger
09c679e75f Refactor module_function to reduce rbi need 2023-04-17 10:37:59 -07:00
Douglas Eichelberger
719f1d6c6e Refactor some use of OpenStruct 2023-02-28 13:05:43 -08:00
Maxim Belkin
d3da5a340d
Bash completions: cache names of 'doctor' checks 2023-02-23 18:36:51 -07:00
John Bampton
1691e615fe Fix spelling 2021-05-08 11:20:01 +10:00
Gautham Goli
c1798a496a Fix shellcheck style errors on bash completion file 2021-05-02 14:58:39 +05:30
Rylan Polster
4e1211d427
Only check for flags if the command defines them 2021-04-27 19:42:28 -04:00
Kid
9dd15d3ca9
Conditional formulae and casks completion for Fish 2021-04-27 19:19:39 -04:00
nandahkrishna
d73b335c77
completions: handle installed/outdated formulae and casks 2021-03-16 10:54:18 +05:30
nandahkrishna
4a4b415186
completions: fix zsh autocompletion issues 2021-03-14 01:27:25 +05:30
hyuraku
8cb80fc2d6 completions: delete brew-cask check 2021-02-16 20:56:19 +09:00
nandahkrishna
8e5451df2f
style: use parentheses for assignment in conditions 2021-02-12 18:33:37 +05:30
Mike McQuaid
0fc2e82dd4
Merge pull request #10435 from jonchang/conflict-zsh-completions
zsh: don't complete conflicting options
2021-01-28 09:24:10 +00:00
Jonathan Chang
fdda2b3414 zsh: prevent autocompleting conflicting options 2021-01-27 14:54:39 +11:00
Rylan Polster
541a981d37
completions: generate fish completions 2021-01-26 10:47:56 -05:00
Rylan Polster
0c5edf4004
Cleanup description handling 2021-01-25 13:46:51 -05:00
Rylan Polster
6cf5d1aa17
completions: add tests 2021-01-25 13:46:51 -05:00
Rylan Polster
3e8b91679d
completions: generate zsh completions 2021-01-25 13:46:51 -05:00
Rylan Polster
4ef8c8279f
completions: complete files where appropriate in bash 2021-01-19 01:03:05 -05:00
Rylan Polster
5a9795016d
completions: add tests for new methods 2021-01-18 03:09:57 -05:00
Rylan Polster
3af16832d9 Generate bash completions automatically 2021-01-15 00:03:28 -05:00
Rylan Polster
4b8477ba70 Completions, Settings: move to Homebrew namespace 2021-01-13 11:20:28 -05:00
Rylan Polster
eb3a662841 completions: clarify that only external tap completions are affected
Co-Authored-By: Mike McQuaid <mike@mikemcquaid.com>
2021-01-12 16:31:24 -05:00
Rylan Polster
f1f3fdc315 settings: add module for managing git config settings 2021-01-12 16:27:25 -05:00
Rylan Polster
e7b369273a completions: link official taps automatically 2021-01-11 12:27:57 -05:00
Rylan Polster
234267cc93 completions: make opt-in only 2021-01-08 11:10:24 -05:00