47 Commits

Author SHA1 Message Date
Douglas Eichelberger
9075cbae62 brew style --fix 2023-04-21 09:58:50 -07:00
Douglas Eichelberger
ac1e6ded9a git grep -l '# typed: false' | xargs gsed -i 's|# typed: false||g' 2023-04-21 09:57:47 -07:00
Issy Long
3a83b5492c
rubocop: Clean up Style/BlockDelimiters excludes and autofix offenses
- The defaults of using "do ... end" for multi-line blocks everywhere is
  good, better than switching everything to braces everywhere.
2023-03-08 23:54:22 +00:00
Mike McQuaid
f280ce069b
Support loading formulae/casks from subdirectories
Previously, we required all formulae and casks to be in a specific
formula or cask directory but did not check any subdirectories.

This commit allows using subdirectories for official taps, the only
ones likely to be big enough to warrant sharding in this way and to
avoid potentially breaking backwards compatibility for existing taps.

This was inspired by the most recent issues with homebrew-cask.
2023-02-24 10:57:41 +00:00
Mike McQuaid
53c57d7a70
tap: return the default_remote if not installed.
Fixes #14656.
2023-02-16 12:25:28 +00:00
Mike McQuaid
59f4b5226a
tests: test on Ubuntu 18.04. 2022-11-09 14:45:43 +00:00
Mike McQuaid
7349c2b996
brew style --fix 2022-09-13 09:43:09 +01:00
xxyzz
2e899da7c7
Add --no-force-auto-update option to brew tap
Enable this option to delete `homebrew.forceautoupdate` git config option
2022-05-11 07:17:17 +08:00
Issy Long
6b76fd012a
Fix (auto-correct) RuboCop RSpec/BeNil offenses 2022-03-01 00:10:10 +00:00
XuehaiPan
63f2f6cca7 tap: allow to change tap remote with brew tap --custom-remote 2021-10-12 01:11:34 +08:00
Bo Anderson
f174d4363f
extend/pathname: limit write override to a refinement 2021-05-04 14:20:20 +01:00
Zach Auten
95c8f445fa Fix bump-formula-pr for taps with ssh remote url. 2021-04-22 22:02:09 -04:00
Rylan Polster
4e61f61a20
utils/github: handle non-standard tap remotes 2021-03-21 12:35:45 -04:00
Mike McQuaid
dc1fdc9f8d
Speedup brew --version.
Port `brew --version` to Bash to speed it up.

While we're here:
- remove (now) unused `Tap` Git methods
- use `--quiet` instead of `-q` to be more verbose

Benchmarks:
```
$ hyperfine --min-runs=3 --warmup=2 "git checkout origin/master; brew --version" "git checkout speedup_brew_version; brew --version"
Benchmark #1: git checkout origin/master; brew --version
  Time (mean ± σ):      2.083 s ±  0.004 s    [User: 396.8 ms, System: 597.2 ms]
  Range (min … max):    2.080 s …  2.088 s    3 runs

Benchmark #2: git checkout speedup_brew_version; brew --version
  Time (mean ± σ):     847.9 ms ±  35.2 ms    [User: 100.0 ms, System: 247.9 ms]
  Range (min … max):   824.1 ms … 888.3 ms    3 runs

Summary
  'git checkout speedup_brew_version; brew --version' ran
    2.46 ± 0.10 times faster than 'git checkout origin/master; brew --version'
```
2021-03-04 12:59:42 +00:00
nandahkrishna
f7c8810214
utils/github/api: remove 'api' from method names 2021-02-17 23:47:05 +05:30
nandahkrishna
56e0c3d9e8
Update GitHub API usage 2021-02-15 22:38:27 +05:30
Rylan Polster
d5d7b6c3db
style: remove RSpec/MultipleDescribes violations
Co-authored-by: Nanda H Krishna <nanda.harishankar@gmail.com>
2021-02-01 20:30:51 -05:00
Rylan Polster
af40e072b0
style: remove RSpec/NamedSubject violations 2021-02-01 20:30:51 -05:00
EricFromCanada
6fc116318e fixes for grammar and wording 2021-01-26 16:19:47 -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
e9d09c4d8f tests: add and fix tests 2021-01-08 17:11:20 -05:00
Rylan Polster
8d5dc76284 Satisfy brew typecheck 2020-11-30 20:32:46 -05:00
Rylan Polster
f8ff0f465f tap: add tests for formula list methods 2020-11-30 18:18:50 -05:00
Markus Reiter
24ae318a3d Move type annotations into files. 2020-10-10 14:59:39 +02:00
Markus Reiter
3118fedab9 Refactor and document Git. 2020-08-23 06:40:07 +02:00
Mike McQuaid
fb0a6338b1
Remove more tap pinning code.
This was deprecated and removed a while ago.
2020-08-06 12:24:10 +01:00
Mike McQuaid
a915114ea7
tap: fix arguments.
- Use Ruby attribute arguments.
- Fix use of `full_clone` in `cmd/tap` to be on by default.
- Remove unnecessary argument in test.
2020-02-05 20:22:21 +00:00
Mike McQuaid
243e703700
tap: default to full clones.
This makes `Tap` consistent with what the installer is doing.

Generally shallow clones get slower and slower (and more and more
pointless) the more they are fetched so don't make sense for our
use-case.

Keep the option around anyway because it's useful for integration tests.
2020-02-02 16:36:37 +01:00
Mike McQuaid
22795d7e30
spec_helper: do cache clearing in single location. 2019-11-06 10:20:57 +00: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
c4f72312ce
Fixup brew style failures. 2019-04-30 09:19:18 +01:00
Mike McQuaid
36dbad3922
Add frozen_string_literal to all files. 2019-04-20 13:27:36 +09:00
Claudia
5be80a78f6
Use Homebrew-controlled domain for Cask dummy URLs
In a number of Cask specs, the value of the `homepage` stanza is currently set
to https://example.com. As of 2018-11-28, the TLS certificate served by
example.com seems to be expired, possibly due to an oversight on ICANN’s side.

While the certificate is certainly going to be renewed soon, it would be
desirable for Homebrew’s test result to be less dependent on ICANN’s actions.
This commit changes the homepages of all test Casks to http://brew.sh, whose
domain and TLS certificate are both controlled by Homebrew.
2018-11-28 20:51:55 +01:00
Mike McQuaid
bcb1ec5499
Improve Homebrew/brew line length.
Use 124 max line length everywhere. Also, reduce tap max line length to
189 as Homebrew/homebrew-core has that as a maximum now. In future
Homebrew/homebrew-core will also be reduced to 124 maximum line length.
2018-09-02 16:15:09 +01:00
Markus Reiter
2912ebfbfe Add test for Tap::from_path. 2018-07-25 11:04:00 +02:00
Markus Reiter
7762ce32aa Use more descriptive heredoc names. 2018-07-11 18:15:30 +02:00
Eli Young
8734848829 Support enabling auto-updates for non-GitHub taps 2018-04-24 11:10:48 -07:00
Mike McQuaid
5e1806e796 test: rubocop-rspec style auto-corrects.
There’s too many warnings to start enabling `rubocop-rspec` by default
but let’s at least apply the cleanups it does automatically.
2018-03-25 13:30:37 +01:00
Markus Reiter
8821cdc492 Include FileUtils in spec_helper. 2017-10-24 19:39:40 +02:00
Shaun Jackman
f9d42659ea pull: Fix pull --bottle 1234
Fix the error:
Error: undefined method `casecmp' for nil:NilClass
2017-10-22 08:52:16 -07:00
Markus Reiter
9bee9ca575 Use “squiggly” heredocs. 2017-10-18 14:39:09 +02:00
Misty De Meo
1c3ece12b9 Tap.each: return an enumerable when no block given 2017-08-03 17:23:16 -07:00
Markus Reiter
2ad3a87045 Silence all specs by default. 2017-07-29 20:25:37 +02:00
Markus Reiter
3cdf8f938a Use scoped RSpec matchers. 2017-05-15 17:23:40 +02:00
Markus Reiter
88676633ef Use described_class in Tap spec. 2017-03-05 18:58:30 +01:00
Markus Reiter
3dcbb84fb5 Convert Tap test to spec. 2017-02-27 23:10:55 +01:00