52 Commits

Author SHA1 Message Date
Bo Anderson
796bad98ff
Allow gem installation on Rubies other than 2.6 2022-11-05 15:23:19 +00:00
Issy Long
295d60b3a2
Gemfile*,dev-cmd/typecheck: Use Spoom for --suggest-typed
- Spoom is the gem that's recommended for automatically changing `typed`
  sigils in files now. It was recommended in the "migrate to Tapioca"
  guide at
  https://github.com/Shopify/tapioca/wiki/Migrating-to-Tapioca#things-that-do-not-need-to-happen.
2022-10-11 01:09:02 +01:00
Bo Anderson
ed2e35853d
Gemfile: stricter Ruby version requirement 2022-08-22 11:11:57 +01:00
Bo Anderson
676ab5181e
Merge pull request #13566 from Bo98/sorbet-runtime
Replace sorbet-runtime-stub with sorbet-runtime
2022-07-21 20:22:46 +01:00
Bo Anderson
4173228c1b
Gemfile: denote minimum Ruby 2022-07-20 13:47:47 +01:00
Bo Anderson
e4264c9f35
Replace sorbet-runtime-stub with sorbet-runtime 2022-07-19 23:43:14 +01:00
Sam Ford
d0961a4e3e
Add addressable to vendored gems 2022-05-18 18:48:16 -04:00
Mike McQuaid
95213893a6
Revert "Livecheck: Use Homebrew curl based on root domain" 2022-05-18 15:36:12 -04:00
Sam Ford
34dd8e3057
Merge pull request #13292 from samford/livecheck/rework-use_homebrew_curl
Livecheck: Use Homebrew curl based on root domain
2022-05-17 16:35:59 -04:00
Sam Ford
fb8a4e5658
Livecheck: Use Homebrew curl based on root domain
At the moment, `#use_homebrew_curl?` can only be true for a
`homepage` or `stable`/cask `url` with `using: :homebrew_curl`. If
the checked URL differs from these URLs, livecheck won't use brewed
curl. This limitation prevents livecheck from using brewed curl for a
`livecheck` block URL that's a string literal (not a symbol for a
`#checkable_url` like `:stable`, `:head`, `:url`). `libzip` was the
original formula referenced in the related brew issue and it meets
this criterion, so it doesn't appear to be handled by the existing
`#use_homebrew_curl?` implementation.

Additionally, the existing behavior can cause livecheck to
unnecessarily use brewed curl for a completely different website
(e.g., `cubelib`, `otf2`). For example, if the `stable` URL has
`using: :homebrew_curl` and the `livecheck` block has `url
:homepage`, livecheck will use brewed curl when checking the
`homepage`. If these are completely different domains/servers, it's
unlikely that we would need to use brewed curl when checking the
`homepage`, so this particular behavior may not be beneficial.

This commit reimplements `use_homebrew_curl?` to apply brewed curl
when the checked URL's root domain is the same as the root domain of
an aforementioned formula/cask URL with `using: :homebrew_curl`. For
example, this looser approach would allow a `livecheck` block
checking `https://www.example.com/downloads/` to use brewed curl if
the `stable` URL was `https://downloads.example.com/example.zip` with
`using: :homebrew_curl`. These could be different servers but, based
on related formulae, this looseness is necessary for the moment.

This approach aims to resolve both issues, allowing brewed curl to be
applied to a slightly broader range of URLs (i.e., not limited to
just the `#checkable_urls`) while also helping to avoid unnecessarily
applying brewed curl when it's less likely to be useful (completely
different domains). Neither approach is perfect but this one may be
more useful in the interim time.

Depending on how this looser approach works in practice, we may want
to consider returning to a stricter approach once we have something
like `using: :homebrew_curl` in `livecheck` blocks (this is
forthcoming). Being explicit in a `livecheck` block is the most
reliable approach (i.e., only use brewed curl when needed), so we
could favor that and pare down the automated approach to only what's
needed to support implicit checks (i.e., with no `livecheck` block).
Of course, it's also possible to drop the automated approach entirely
and simply require a `livecheck` block in this scenario but we can
decide on how to handle this when the time comes.
2022-05-17 00:34:32 -04:00
Bo Anderson
7e07f66e47
Use sorbet-static-and-runtime 2022-05-17 04:15:50 +01:00
Bo Anderson
1a3967ac4f
Gemfile: restrict activesupport version range 2021-12-16 15:30:26 +00:00
Bo Anderson
02724df0d6
Move json_schemer install to Gemfile 2021-09-10 03:08:21 +01:00
Bo Anderson
07239d267c
Migrate from Sorbet DSL plugins to Parlour 2021-08-06 13:32:48 +01:00
Sam Ford
2342dcd90c
Add comment to Gemfile about disallowed gems 2021-06-30 09:11:47 -04:00
Sam Ford
bb463376e8
Remove nokogiri from Gemfile 2021-06-30 09:11:46 -04:00
Alexander Bayandin
1595a908df
Merge pull request #11565 from bayandin/fuzzy-search-and-did-you-mean
Formula fuzzy search and did you mean
2021-06-23 18:27:10 +01:00
Alexander Bayandin
4c57b9d8f8
Gemfile: add did_you_mean gem 2021-06-22 18:06:53 +01:00
Jason Rudolph
e163eb8650
Enhance test suite to emit JUnit XML test reports
In preparation for detecting flaky tests with BuildPulse, this commit
sets up the rspec_junit_formatter gem to output JUnit XML reports of the
test suite, which is the format used by BuildPulse and various other
tooling that interprets test results.

Because the test suite uses the parallel_tests gem, this commit
incorporates some related changes to make all the parallel_tests gem and
the rspec_junit_formatter gem to cooperate with each other.

rspec_junit_formatter writes everything to a single XML file. That works
fine when there's only one process writing to the file. By default,
whatever process finishes last will write to the file and clobber the
output of all the other processes that wrote to the file. 🙈

To prevent this issue, the parallel_tests wiki recommends adding a
`.rspec_parallel` file to specify its RSpec options
(https://github.com/grosser/parallel_tests/wiki#with-rspec_junit_formatter----by-jgarber),
then the project can specify different files for each process to write
to like so:

  --format RspecJunitFormatter
  --out tmp/rspec<%= ENV['TEST_ENV_NUMBER'] %>.xml

However, prior to this commit, the Homebrew/brew test suite specified
its RSpec options via the command line. Unfortunately though, there's no
way (AFAICT) to set the equivalent of these options via the command
line:

  --format RspecJunitFormatter
  --out tmp/rspec<%= ENV['TEST_ENV_NUMBER'] %>.xml

So, we need to use a `.rspec_parallel` file to specify these options ☝️.

However, it appears that RSpec allows you to specify formatters _either_
in an options file (like `.rspec_parallel`) _or_ via command-line args.
But if you specify any formatters via command-line args, then all
formatters in the options file are ignored.  (I suspect that's somehow
related to this bit of code in rspec-core:
https://github.com/rspec/rspec-core/blob/v3.10.0/lib/rspec/core/configuration_options.rb#L64.)

With that in mind, in order to have the RspecJunitFormatter configured
 in `.rspec_parallel`, we need to move the other formatters into
 `.rpsec_parallel` as well, instead of passing them as command-line
 args. Therefore, this commit moves all the formatters into a
 `.rspec_parallel` file.
2021-06-21 13:14:18 -04:00
Bo Anderson
a06d136d2c
Move Sorbet gems into an optional group 2021-06-11 08:10:30 +01:00
Tom Hu
bba27eefec
Use double quotes 2021-04-01 20:29:27 -04:00
Tom Hu
0947ab6c29
Use simplecov-cobertura 2021-04-01 18:59:46 -04:00
Tom Hu
ff7c05a285
Merge branch 'master' into codecov-action 2021-03-21 14:58:03 -04:00
Bo Anderson
bb4e74042a
formula_assertions: use minitest
We are migrating away from using system gems, and we already have minitest in our dependency tree, so we might as well use it.
2021-02-26 18:23:07 +00:00
Rylan Polster
3595ac1f7f
style: call rubocop directly 2021-02-10 22:36:42 -05:00
Tom Hu
1fb58d5b2f Add Codecov GitHub Action step 2021-02-03 22:46:05 -05:00
Mike McQuaid
89fc131422
Gemfile: install bootsnap.
And allow type checking of `homebrew_bootsnap.rb`.
2021-02-02 12:34:15 +00:00
Mike McQuaid
683ae7ff53
Add HOMEBREW_BOOTSNAP to optionally use Bootsnap
> Bootsnap is a library that plugs into Ruby, with optional support
> for ActiveSupport and YAML, to optimize and cache expensive
> computations.
https://github.com/Shopify/bootsnap

For our case that translates to "repeated calls to `brew` have
reductions in the time spend `require`ing speeding up the process
boot time".

For example:

```
$ hyperfine --warmup=2 "unset HOMEBREW_BOOTSNAP; brew info wget" "export HOMEBREW_BOOTSNAP=1; brew info wget"
Benchmark #1: unset HOMEBREW_BOOTSNAP; brew info wget
  Time (mean ± σ):      2.417 s ±  0.032 s    [User: 659.0 ms, System: 855.5 ms]
  Range (min … max):    2.382 s …  2.464 s    10 runs

Benchmark #2: export HOMEBREW_BOOTSNAP=1; brew info wget
  Time (mean ± σ):      1.862 s ±  0.064 s    [User: 425.3 ms, System: 566.8 ms]
  Range (min … max):    1.736 s …  1.952 s    10 runs

Summary
  'export HOMEBREW_BOOTSNAP=1; brew info wget' ran
    1.30 ± 0.05 times faster than 'unset HOMEBREW_BOOTSNAP; brew info wget'
```
2021-01-21 12:34:04 +00:00
Seeker
332778025a utils/ast: add Sorbet method signatures 2021-01-07 13:54:05 -08:00
Issy Long
3c2467fc3d
Replace test/support/github_formatter with rspec-github gem
- This was a TODO in `test/support/github_formatter.rb` and the PR it
  referenced had been merged.
2020-12-22 18:03:01 +00:00
Markus Reiter
e3818ee51e Fix parsing version from PackageInfo files. 2020-12-14 15:29:32 +01:00
Mike McQuaid
8528eff604
Add and enable rubocop-rails.
This will help us catch and cleanup usage of e.g. `.blank?` and other
helpers we use from ActiveSupport.
2020-12-02 10:43:04 +00:00
Markus Reiter
ae8ebf9464 Add rspec-sorbet. 2020-11-19 16:14:22 +01:00
Markus Reiter
772a45e758 Vendor sorbet-runtime-stub. 2020-10-09 16:45:13 +02:00
Markus Reiter
f27d7a21d7 Vendor rubocop-sorbet. 2020-10-09 16:45:13 +02:00
Mike McQuaid
6f311852d6 Fix unvendored RubyGems
- Avoid caching RubyGems in GitHub Actions `tests.yml` to catch this in
  future.
- Run `brew doctor` in GitHub Actions `tests.yml` after installing
  RubyGems to catch this in future.
- Ignore relevant RubyGems (and fix outdated comments)
- Never auto-`require` RubyGems that aren't vendored.
- Update `bundler/setup.rb`.
2020-08-27 14:03:03 +01:00
Issy Long
25ce3875a4
Gemfile: Unpin sorbet version
- This was originally pinned in 1a6467eeeab8887ff404ff87b8b15d6c50c0525c
  because we found that later versions surfaced over 100 new typing errors
  in Tapioca's autogenerated RBI files. It seems like these are able to
  be fixed now.
2020-08-09 12:03:30 +01:00
vidusheeamoli
53ebef4c67 Gemfile: drop sorbet environment 2020-08-09 02:40:01 +05:30
Mike McQuaid
dff330e336
Merge pull request #8034 from rmNULL/pelf-gemlock
include  patchelf.rb and its deps in Gemfile.lock
2020-07-22 09:58:49 +01:00
vidusheeamoli
1a6467eeea Gemfile: set sorbet version 2020-07-21 23:45:34 +05:30
rmnull
ff66534242
add patchelf to Gemfile 2020-07-21 13:30:40 +05:30
Mike McQuaid
170b38892a
Use CodeCov for coverage reporting. 2020-07-02 10:22:54 +01:00
rmnull
486114282c
In ELFShim, #needed_libraries, #dynamic_elf? and #with_interpreter? check using patchelf gem.
Having HOMEBREW_PATCHELF_RB set in the ENV,
will conditionally install patchelf.rb gem,
use patchelf.rb in the above mentioned methods.
The installed vendored gems are listed in .gitignore
to maintain a clean state.
2020-06-19 21:23:57 +05:30
vidusheeamoli
73d2c98689 Gemfile: add tapioca gem 2020-06-14 02:01:10 +05:30
vidusheeamoli
5ef55d9637 homebrew-sorbet env 2020-06-11 16:46:05 +05:30
vidusheeamoli
536726799d Gemfile: add sorbet and sorbet-runtime
bundler/setup: add sorbet and sorbet-runtime
2020-06-11 11:41:53 +05:30
vidusheeamoli
4f1e9f44a1 set up byebug debugger 2020-05-18 16:28:43 +05:30
Mike McQuaid
a36f00ae8b
Ruby 2.6 (and remove backports) gems 2019-10-10 16:17:05 +01:00
Markus Reiter
b1d0c61fea Update Gems. 2019-10-03 09:22:44 +02:00
Mike McQuaid
738f4689a5
Add rubocop-performance gem. 2019-04-30 08:44:10 +01:00