100 Commits
Author SHA1 Message Date
Issy LongandIssy Long 14dd3592dc rubocop/no_fileutils_rmrf: Discourage Pathname#rmtree too
- This [seems to be](https://ruby-doc.org/3.3.4/exts/pathname/Pathname.html#method-i-rmtree)
  equivalent to `FileUtils#rm_r`, so replace it with that.
2024-08-01 18:28:00 +01:00
Issy LongandIssy Long cc7784605d rubocop/no_fileutils_rmrf: Reorganize tests 2024-08-01 18:28:00 +01:00
Issy LongandIssy Long ebd9d183dc rubocop/no_fileutils_rmrf: Extend to cover FileUtils#rmtree too 2024-08-01 18:28:00 +01:00
Issy LongandIssy Long f4e4808553 rubocop/no_fileutils_rmrf: Extend to cover FileUtils#rm_f too 2024-08-01 18:28:00 +01:00
Issy LongandIssy Long e6976ae3d1 rubocop: Discourage the use of FileUtils.rm_rf
- This cop checks for the use of `FileUtils.rm_rf` and suggests using
  `FileUtils.rm_r` because we should know if we couldn't delete a
  thing for some reason, not just force it.
2024-08-01 18:27:59 +01:00
Issy LongandIssy Long 7282b4d7a2 os: Bump to Sorbet typed: strict 2024-07-17 16:01:59 -04:00
Issy Long ecdd45e73e formula_assertions: Fix type of cmd param in shell_output
- This can be either a String or a Pathname, per
  the part of the `noseyparker` test that failed
  (in a different part of the test, the command is
  passed as a string).

```
  ==> Testing noseyparker
  ==> /opt/homebrew/Cellar/noseyparker/0.18.1/bin/noseyparker -V
  Error: noseyparker: failed
  An exception occurred within a child process:
    TypeError: Parameter 'cmd': Expected type String, got type Pathname with value #<Pathname:/opt/homebrew/Ce...ps://github.com/Homebrew/brew>
  Caller: /opt/homebrew/Library/Taps/homebrew/homebrew-core/Formula/n/noseyparker.rb:35
```
2024-07-12 16:28:35 -04:00
Issy Long af6e1194d2 unpack_strategy/dmg: Convert to Sorbet typed: strict
- I missed this, whoops.
2024-07-11 21:34:26 -04:00
Issy Long edb8055c76 unpack_strategy/*: Convert to Sorbet typed: strict 2024-07-11 21:18:27 -04:00
Issy Long d7123d43c7 test/dev-cmd/bottle: Mark the bottling test as needs_network
- I was on a plane and this failed with:

```
expected block to not output to stderr, but output
"curl: (6) Could not resolve host: spdx.github.io\nWarning: Failed to fetch SBOM schema, cannot perform SBOM validation!
Warning: Could not fetch JSON schema to validate SBOM!\nWarning: SBOM is not valid, not writing to disk!"
```
2024-07-11 21:16:14 -04:00
Issy Long bffb470c57 unpack_strategy: Fix ref_type type (Symbol, not String)
- I put a debugger call in the test that was failing.
- Running the install command at that debug prompt and lo,
  the typing bug was staring me in the face:

```
Error: An exception occurred within a child process:
  TypeError: Parameter 'ref_type': Expected type T.nilable(String), got type Symbol with value :branch
Caller: /opt/homebrew/Library/Homebrew/vendor/bundle/ruby/3.3.0/gems/sorbet-runtime-0.5.11471/lib/types/private/methods/call_validation.rb:215
Definition: /opt/homebrew/Library/Homebrew/unpack_strategy.rb:102 (UnpackStrategy.detect)
```
2024-07-11 19:37:46 +01:00
Issy Long 9c6430954b All the extract_to_dirs return void now 2024-07-11 11:05:47 +01:00
Issy Long 517d3c9bcf dev-cmd/bump-formula-pr: Fix types for fetch_resource_and_forced_version
- This should fix https://github.com/Homebrew/homebrew-core/actions/runs/9839505520, that is:

```
Parameter 'tag': Expected type Float, got type String with value "2024-07-05"
Caller: /home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/vendor/bundle/ruby/3.3.0/gems/sorbet-runtime-0.5.11473/lib/types/private/methods/call_validation.rb:215
Definition: /home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/dev-cmd/bump-formula-pr.rb:445 (Homebrew::DevCmd::BumpFormulaPr#fetch_resource_and_forced_version)
```

- I think I read https://sorbet.org/docs/sigs#rest-parameters too literally,
  yes Sorbet expands the kwargs into a hash type, but it's the value type that
  needs specifying in the sig (which for us is `String`).
2024-07-08 18:46:21 +01:00
Issy Long 0a18f77de4 Apply suggestions from code review 2024-07-06 15:22:08 +01:00
Issy Long cd1869437d unpack_strategy: Convert to Sorbet typed: strict 2024-07-05 18:48:02 +01:00
Issy Long ed4b6d4246 development_tools: Convert to Sorbet typed: strict 2024-07-05 18:17:31 +01:00
Issy Long fdd7fdd2f6 formula_assertions: Convert to Sorbet typed: strict 2024-07-05 15:37:59 +01:00
Issy Long bd9c7777e8 utils/shebang: Convert to Sorbet typed: strict 2024-07-05 15:37:59 +01:00
Issy Long 58fb8afa2f dev-cmd/bump-formula-pr: formula_version is Version not String
- Fixes https://github.com/Homebrew/brew/issues/17626.
2024-07-04 17:52:38 +01:00
Issy Long f2f4f1c06d sorbet: Tighten up dev-cmd types
- Change `returns(NilClass)` to `void`.
- Get rid of some of the `T.untyped`.
2024-07-04 12:04:29 +01:00
Issy Long 4b83521061 dev_cmd/irb: Straight away require "formula"
- Otherwise we get: `uninitialized constant String::Formula (NameError)```
2024-07-03 20:39:36 +01:00
Issy Long b6f142f7a9 Fewer T.musts 2024-07-03 19:53:37 +01:00
Issy Long 3d09094df0 Fewer T.musts 2024-07-02 16:20:39 +01:00
Issy Long 1db0834a91 dev-cmd/bottle: The cellar_parameter_needed? method returns always boolean 2024-07-02 11:21:29 +01:00
Issy Long b9b065a54e dev-cmd/bottle: Fix type errors (strings, symbols, either, none) thanks to the tests 2024-07-02 00:03:28 +01:00
Issy Long 9130dd1210 dev-cmd/contributions: Tighten up type sigs 2024-07-01 23:49:31 +01:00
Issy Long 3b695c6aa2 dev-cmd/bottle: Bump to Sorbet typed: strict 2024-07-01 23:38:26 +01:00
Issy Long 8360218a3e Run brew style on all the new Sorbet sigs 2024-07-01 19:16:57 +01:00
Issy Long f854a9f3fc dev-cmd/audit: Bump to Sorbet typed: strict 2024-07-01 19:11:17 +01:00
Issy Long 9e0a749231 dev-cmd/extract: Can't be typed: strict because of undef usage 2024-07-01 18:40:12 +01:00
Issy Long b1817391a8 dev-cmd/pr-pull: Bump to Sorbet typed: strict 2024-07-01 18:07:47 +01:00
Issy Long 8587f4ba11 dev-cmd/bump-formula-pr: Bump to Sorbet typed: strict 2024-07-01 13:14:47 +01:00
Issy Long 6b995ad111 dev-cmd/pr-upload: Bump to Sorbet typed: strict 2024-06-30 20:58:10 +01:00
Issy Long d5af469e85 dev-cmd/tests: Bump to Sorbet typed: strict 2024-06-30 20:41:02 +01:00
Issy Long 0837f7c23c dev-cmd/test: Bump to Sorbet typed: strict 2024-06-30 19:30:35 +01:00
Issy Long 3bf6a01516 dev-cmd/generate-formula-api: Bump to Sorbet typed: strict 2024-06-30 19:29:22 +01:00
Issy Long 944790acfe dev-cmd/generate-cask-api: Bump to Sorbet typed: strict 2024-06-30 19:27:35 +01:00
Issy Long 3b28e90556 dev-cmd/tap-new: Bump to Sorbet typed: strict 2024-06-30 19:25:19 +01:00
Issy Long 69cf1df56f dev-cmd/livecheck: Bump to Sorbet typed: strict 2024-06-30 19:23:26 +01:00
Issy Long 57ba22053f dev-cmd/update-sponsors: Bump to Sorbet typed: strict 2024-06-30 19:10:38 +01:00
Issy Long 1b517a9d49 dev-cmd/irb: Bump to Sorbet typed: strict 2024-06-30 19:07:38 +01:00
Issy Long c57cd4bf98 dev-cmd/contributions: Bump to Sorbet typed: strict 2024-06-30 18:42:16 +01:00
Issy Long 34caeb7ea8 dev-cmd/unbottled: Bump to Sorbet typed: strict 2024-06-30 17:49:27 +01:00
Issy Long 8c9a6e3379 Add a comment for what and why we're rescuing 2024-06-27 12:27:30 +01:00
Issy Long c8504427cb CurlDownloadStrategy: Ignore invalid last-modified header values
- Some download locations return a non-standard formatting of date string for the `Last-Modified` header.
  This causes `Time.parse` to blow up. The user sees `error: argument out of range`.
- In this commit we handle the error and return nil, which `filter_map` (equivalent to `.map.compact`) gets rid of and then `time.last` is as normal.
- Fixes https://github.com/Homebrew/brew/issues/ 17556.
2024-06-26 20:00:45 +01:00
Issy Long 80be27dc9b Make brew typecheck --update --suggest-typed bump strictness further
- Not only `false` to `true` but `true` to `strict`.
- Only humans every run this, but our goal is to increase the
  typechecking in our files to get to `strict` everywhere so
  let's make that easy to remember to do.
2024-06-02 18:53:38 +01:00
Issy Long 509fffab2b Make more files Sorbet typed: strict
- According to Spoom, these could be bumped automatically with no errors.
2024-06-02 15:15:24 +01:00
Issy Long a23dad737f Fix constructing search query strings with date ranges
- Both `from` and `to` are now separate keyword arguments
  in a bunch of places, not part of `args`.
- When we switched this around, we didn't realize this
  method needed updating to correctly construct the time
  range query.
- This led to further inaccurate counts in `brew contributions`
  for reviews, since `from` and `to` are not valid search qualifiers
  for the GitHub PR search APIs.
2024-06-02 14:31:18 +01:00
Issy Long 1f9c764a69 dev-cmd/contributions: Pass from correctly through count_reviews too 2024-05-28 14:10:25 +01:00
Issy Long 808cfda92d dev-cmd/contributions: Fix the date range behaviour
- This was broken (I did have a commit SHA for the breakage but I can't find it now) since `from` and `args.from` are different variables (one can be nil, the other has a default value).
- So it was reporting very high counts because, despite the message, the `from` restriction was not being passed to `count_repo_commits`.
2024-05-28 13:58:41 +01:00
Issy Long 9f915a6a62 Replace FormulaTextAuditor usage
- Only two audits were using this: `audit_keg_only_reason` and `audit_text`,
  and they weren't using any of its text processing methods, so there's little
  reason to keep it around.
- The "`keg_only_reason` shouldn't contain 'HOMEBREW_PREFIX'" audit can easily
  be replaced with a RuboCop since that's "just" text parsing.
- The "tests should invoke binaries with `bin/<command>`" audit had to stay as
  a FormulaAudit because it requires accessing attributes about the Formula
  like its name, aliases, which RuboCop can't get to, but it was easy to move the
  singular "read the text in the file" line from `FormulaTextAuditor`.
2024-05-04 22:14:55 +01:00
Issy Long 69c31d275f Only brew desc --search needs --eval-all
- It was suggested in https://github.com/Homebrew/brew/issues/ 16733 that
  `brew desc <formula_or_cask>` should work like `brew info <formula_or_cask>`
  and print the description of the package without needing `--eval-all`.
- Looking at the code, it seems like it's only searching that needs
  `--eval-all`, so limit the check to that.

Before:

```shell
$ brew desc hello
Error: `brew desc` needs `--eval-all` passed or `HOMEBREW_EVAL_ALL` set!
```

After:

```shell
$ brew desc hello
hello: Program providing model for GNU coding standards and practices

$ brew desc --search hello
Error: Invalid usage: `brew desc --search` needs `--eval-all` passed or `HOMEBREW_EVAL_ALL` set!

$ brew desc --search --eval-all hello
==> Formulae
dsh: Dancer's shell, or distributed shell
hello: Program providing model for GNU coding standards and practices
```
2024-04-17 23:54:45 +01:00
Issy Long 4c64193b9b Set HOMEBREW_DEBUG when running brew tests --debug
- This will cause the "debug" gem to be required in `spec_helper.rb`, so we can do interactive debugging.
2024-04-17 23:26:40 +01:00
Issy Long 9cf5334469 Load debug.so extensions along with the debug gem itself
- This doesn't work still, but now for new reasons.

```
     NoMethodError:
       undefined method `b' for #<Binding:0x0000000107a7e088>

             binding.b
                    ^^
     # ./test/migrator_spec.rb:72:in `block (3 levels) in <top (required)>'
```

and if I add `require "debug"` to the spec_helper again it gives:

```
LoadError:
  cannot load such file -- debug
```

but, doing a `require "debug"; binding.b` in `migrator_spec` _does_ work.

Where is the require coming from where it works some of the time but not through all of the layers we have?
2024-04-17 23:26:40 +01:00
Issy Long 073e739005 Use the debug gem from portable Ruby
- This is cleaner than vendoring a whole bunch of new gems and pinning `psych`.
- Thanks for the pointer, Bo!
- It doesn't work, though?

```
❯ brew tests --only=migrator --debug
Error: cannot load such file -- debug/debug.so
Warning: Removed Sorbet lines from backtrace!
Rerun with `--verbose` to see the original backtrace
/opt/homebrew/Library/Homebrew/vendor/portable-ruby/3.1.4/lib/ruby/gems/3.1.0/gems/debug-1.6.3/lib/debug/frame_info.rb:16:in `require'
/opt/homebrew/Library/Homebrew/vendor/portable-ruby/3.1.4/lib/ruby/gems/3.1.0/gems/debug-1.6.3/lib/debug/frame_info.rb:16:in `rescue in <module:DEBUGGER__>'
/opt/homebrew/Library/Homebrew/vendor/portable-ruby/3.1.4/lib/ruby/gems/3.1.0/gems/debug-1.6.3/lib/debug/frame_info.rb:13:in `<module:DEBUGGER__>'
/opt/homebrew/Library/Homebrew/vendor/portable-ruby/3.1.4/lib/ruby/gems/3.1.0/gems/debug-1.6.3/lib/debug/frame_info.rb:3:in `<top (required)>'
/opt/homebrew/Library/Homebrew/vendor/portable-ruby/3.1.4/lib/ruby/gems/3.1.0/gems/debug-1.6.3/lib/debug/session.rb:31:in `require_relative'
/opt/homebrew/Library/Homebrew/vendor/portable-ruby/3.1.4/lib/ruby/gems/3.1.0/gems/debug-1.6.3/lib/debug/session.rb:31:in `<top (required)>'
/opt/homebrew/Library/Homebrew/vendor/portable-ruby/3.1.4/lib/ruby/gems/3.1.0/gems/debug-1.6.3/lib/debug.rb:3:in `require_relative'
/opt/homebrew/Library/Homebrew/vendor/portable-ruby/3.1.4/lib/ruby/gems/3.1.0/gems/debug-1.6.3/lib/debug.rb:3:in `<top (required)>'
/opt/homebrew/Library/Homebrew/dev-cmd/tests.rb:48:in `require'
/opt/homebrew/Library/Homebrew/dev-cmd/tests.rb:48:in `run'
/opt/homebrew/Library/Homebrew/brew.rb:89:in `<main>'
```
2024-04-17 23:26:40 +01:00
Issy Long 621e51a6c9 Don't require "debug" in brew tests - it's in our RSpec config 2024-04-17 22:25:12 +01:00
Issy Long f2a64f3808 Fix RuboCop and exclude psych from RBI generation 2024-04-17 22:25:12 +01:00
Issy Long 1daeb5bee0 Set up the debug gem for test debugging
- This processed that we'd requested a debugger, but didn't drop us into
  a debugging console until I
  [stopped the stdin disablement](https://github.com/Homebrew/brew/issues/16708#issuecomment-1953483970).

Usage:

```
❯ git diff
diff --git a/Library/Homebrew/test/migrator_spec.rb b/Library/Homebrew/test/migrator_spec.rb
index 87fadd5e95..db4700810a 100644
--- a/Library/Homebrew/test/migrator_spec.rb
+++ b/Library/Homebrew/test/migrator_spec.rb
@@ -69,6 +69,8 @@ RSpec.describe Migrator do
       tab.source["tap"] = "homebrew/core"
       tab.write

+      binding.break
+
       expect do
         described_class.new(new_formula, "oldname")
       end.to raise_error(Migrator::MigratorDifferentTapsError)

issyl0 at pictor in /opt/homebrew on bye-byebug
❯ brew tests --only=migrator --debug
Randomized with seed 59158
1 process for 1 spec, ~ 1 spec per process
.==> Relinking newname
.==> Unlinking oldname
...==> Moving oldname versions to /private/tmp/homebrew-tests-20240403-85464-3uogqr/cellar/newname
....==> Migrating formula oldname to newname
==> Unlinking oldname
==> Moving oldname versions to /private/tmp/homebrew-tests-20240403-85464-3uogqr/cellar/newname
==> Relinking newname
....[67, 76] in ~/migrator_spec.rb
    67|       tab = Tab.empty
    68|       tab.tabfile = HOMEBREW_CELLAR/"oldname/0.1/INSTALL_RECEIPT.json"
    69|       tab.source["tap"] = "homebrew/core"
    70|       tab.write
    71|
=>  72|       binding.break
    73|
    74|       expect do
    75|         described_class.new(new_formula, "oldname")
    76|       end.to raise_error(Migrator::MigratorDifferentTapsError)
=>#0    block in <top (required)> (3 levels) at ~/migrator_spec.rb:72
  #1    [C] BasicObject#instance_exec at /opt/homebrew/Library/Homebrew/vendor/bundle/ruby/3.1.0/gems/rspec-core-3.13.0/lib/rspec/core/example.rb:263
  # and 68 frames (use `bt' command for all frames)
(rdbg@/opt/homebrew/Library/Homebrew/vendor/bundle/ruby/3.1.0/bin/rspec#85464) p tab
(rdbg@/opt/homebrew/Library/Homebrew/vendor/bundle/ruby/3.1.0/bin/rspec#85464) p    # command(rdbg@/opt/homebrew/Library/Homebrew/vendor/bundle/ruby/3.1.0/bin/rspec#85464) p     # command t    # command ta    # command tab    # command(rdbg@/opt/homebrew/Library/Homebrew/vendor/bundle/ruby/3.1.0/bin/rspec#85464) p tab    # command
=> #<Tab:0x0000000107156be0 @aliases=[], @arch=nil, @built_as_bottle=false, @built_on={"os"=>"Macintosh", "os_version"=>"macOS 14", "cpu_family"=>"arm_firestorm_icestorm"}, @compiler=:clang, @homebrew_version="4.2.16-55-gc8f60ec-dirty", @installed_as_dependency=false, @installed_on_request=false, @loaded_from_api=false, @poured_from_bottle=false, @runtime_dependencies=nil, @source={"path"=>nil, "tap"=>"homebrew/core", "tap_git_head"=>nil, "spec"=>"stable", "versions"=>{"stable"=>nil, "head"=>nil, "version_scheme"=>0}}, @source_modified_time=0, @stdlib=nil, @tabfile=#<Pathname:/private/tmp/homebrew-tests-20240403-85464-3uogqr/cellar/oldname/0.1/INSTALL_RECEIPT.json>, @time=nil, @unused_options=[], @used_options=[]>
(rdbg@/opt/homebrew/Library/Homebrew/vendor/bundle/ruby/3.1.0/bin/rspec#85464)
```
2024-04-17 22:25:12 +01:00
Issy Long 58fbaecedb Add the debug gem for test debugging 2024-04-17 22:25:10 +01:00
Issy Long 11c1960729 Remove byebug since it doesn't work in tests anymore
- Byebug was introduced in [2020](https://github.com/Homebrew/brew/pull/7577) for hooking into tests for debugging.
- It does not work anymore in so far as it does not stop at breakpoints when following the instructions to trigger them in tests.
2024-04-17 22:24:21 +01:00
Issy Long dd5ea99f58 Alphabetize EnvConfig::ENVS and regenerate docs 2024-04-11 17:58:08 +01:00
Issy LongandHana c72598d937 Test that EnvConfig::ENVS hash keys are alphabetical
- Spoiler: they aren't.
- As part of Volunteer Month at work I introduced `hharen` to contributing to
  Homebrew, `cd $(brew --repo)`, `brew tests`, `brew style`, etc.
- We started to write a RuboCop for this. But my current thinking is that this
  test might be sufficient since it might be easier to notice "oop, a test is
  failing and I've added a new envvar" and re-alphabetize it than to write a
  RuboCop linter for it to do the one-time autofix. Considering how little this
  gets changed?

Co-authored-by: Hana <hharen@github.com>
2024-04-11 17:58:08 +01:00
Issy LongandGitHub 3f1ae21faa Merge pull request #16980 from Homebrew/tapioca-compiler-for-envconfig-rbi
Convert the `EnvConfig` RBI generator to a Tapioca compiler
2024-03-30 20:06:09 +00:00
75db3b8e21 Apply suggestions from code review
Co-authored-by: Douglas Eichelberger <697964+dduugg@users.noreply.github.com>
2024-03-30 19:54:51 +00:00
Issy Long 9dfe11870e Convert the EnvConfig RBI generator to a Tapioca compiler 2024-03-30 18:30:20 +00:00
Issy LongandGitHub a3932b44c0 Merge pull request #16899 from Homebrew/tapioca-compiler-for-tty-rbi
Convert the `utils/tty` RBI generator to a Tapioca compiler
2024-03-30 18:10:41 +00:00
Issy Long db39e939b0 Apply suggestions from code review 2024-03-30 18:00:39 +00:00
Issy Long e4a1f3319c Tty methods are class methods 2024-03-29 00:41:56 +00:00
Issy Long bbf5825d54 Appease RuboCop 2024-03-29 00:41:56 +00:00
Issy Long 05b716613b Convert the utils/tty RBI generator to a Tapioca compiler
- The preferred way of doing RBI generation is via Tapioca. So I am
  trying to stop being intimidated by it, by learning how it works.
- This is very WIP still, currently failing with the following message
  because the `module` name is missing in the generated RBI file.

```
There are parse errors in the generated RBI files.

Errors:
  sorbet/rbi/dsl/tty.rbi:8: unexpected token tNL (2001)
  sorbet/rbi/dsl/tty.rbi:64: unexpected token "end" (2001)
```
2024-03-29 00:41:56 +00:00
Issy Long c2507fdc6d formula_audit: Check the license(s) of the specific release
- Some repositories occasionally change their licenses. For example they
  release a version of the software with one license and then decide to change
  the license later.
- Now that `?ref=` is a parameter to the GitHub Repositories License API,
  we can use that in the license audit to check if the license of the specific
  release matches the one declared in the formula.
2024-02-27 16:53:54 +00:00
Issy LongandGitHub 7848bd3226 Merge pull request #16745 from issyl0/rubocop-todos-2
rubocop: Fix remaining TODOs for triaging Ruby 3 cops
2024-02-26 16:19:14 +00:00
Issy Long e654af3e15 Disable RuboCop Naming/BlockForwarding and Style/ArgumentsForwarding
- These break Sorbet type signatures:

```
      RuntimeError:
        The declaration for  is missing parameter(s): &
```
2024-02-25 23:00:07 +00:00
Issy Long c11a07db5b Alphabetize Style/HashSyntax RuboCop rule and keep it the same 2024-02-25 23:00:07 +00:00
Issy Long 921753cf84 Fix RuboCop Performance/BindCall offenses 2024-02-25 23:00:07 +00: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
Issy Long c86a402110 Fix RuboCop Lint/RedundantDirGlobSort offenses 2024-02-24 23:59:31 +00:00
Issy LongandGitHub 6a9c9c00a0 Merge pull request #16718 from issyl0/pyyaml-resource-needs-specific-deps-too
rubocop: The `pyyaml` resource requires `depends_on "libyaml"`
2024-02-21 08:10:59 +00:00
Issy Long ff21ef0955 It helps if you actually require the new cop to run it on real code 2024-02-20 23:49:25 +00:00
Issy Long 3bfe7e5aa1 Handle nil resource args for some reason
- Ran this against `signal-cli` and despite it having a valid-looking resource block, it failed on `undefined method 'str_content' for nil:NilClass`.
2024-02-20 23:48:58 +00:00
Issy Long 5c7be57531 Appease Sorbet 2024-02-20 23:36:52 +00:00
Issy Long a895496982 rubocop: The pyyaml resource requires depends_on "libyaml" 2024-02-20 23:22:15 +00:00
ff23de4766 Formatting and cope with more modern RSpec config changes
Co-authored-by: Ruoyu Zhong <zhongruoyu@outlook.com>
2024-02-20 12:17:27 +00:00
Issy Long 33c33b5338 rubocop: Formulae with the "lxml" resource have required dependencies
- We're moving from `depends_on "python-lxml"` to `resource "lxml" ...` as part
  of the new Python vendoring plan.
- For `resource "lxml"` to work, `uses_from_macos "libxml2"` and
  `uses_from_macos "libxslt"` are needed in the formulae.
- This new RuboCop rule enforces that a formula including the "lxml" resource
  also include those dependencies.
2024-02-19 22:50:55 +00:00
Issy LongandGitHub dbb10da4b0 Merge pull request #16585 from issyl0/rm-ancient-flowchart
Delete ancient 'managing PRs' flowchart
2024-02-05 16:05:04 +01:00
Issy Long a8beb98bad PRs raised at 2am are only half done, zzzz 2024-02-05 15:49:40 +01:00
Issy Long d0795d2b9d Delete ancient 'managing PRs' flowchart
- This diagram was really old and didn't reflect the current practices
  (a lot more things are automated now, hurray).
- Anything we replace it with will get outdated fast too.
- Also delete the diagramming docs since I don't believe we have made
  another diagram since this one which got out of date and forgotten
  about since it was a DrawIO SVG and not easily editable as code.
- If we want diagrams these days, we can use Mermaid which is
  diagrams-as-code.
2024-02-05 01:47:55 +01:00
Issy LongandGitHub 06028c204a Merge pull request #16518 from issyl0/rubocop-md
rubocop: Try out `rubocop-md` for linting the code in our docs
2024-02-02 15:49:46 +00:00
Issy LongandGitHub ca92fca770 Turn off FormulaAudit/{Desc,Homepage} for docs
- We don't need this blanket enabled, we only have a few docs where it actually matters that there's a description, it's just cruft having to invent descriptions.
2024-02-02 15:37:01 +00:00
Issy LongandGitHub bcd3a78f6d Ignore the generated manpage; reinstate its trailing whitespace 2024-02-02 15:24:17 +00:00
Issy Long 3ee62bb244 Update example formula descriptions 2024-01-29 22:43:36 +00:00
Issy Long 3955a70a26 Delete easily outdated template docs for brew create 2024-01-29 22:39:12 +00:00
Issy Long 3f5ae06ab1 Allow a longer Layout/LineLength for just the bottle blocks 2024-01-27 12:32:46 +00:00
Issy Long aaddc66548 Fix remaining RuboCop FormulaAudit offenses in example code 2024-01-27 12:30:00 +00:00
Issy LongandGitHub bf44e74a01 Fix Sorbet - don't need the T.musts anymore 2024-01-25 23:11:37 +00:00
Issy LongandGitHub a6b8a795b4 Merge pull request #16365 from issyl0/rubocop-cask-zap-arrays-alphabetical
Add a new RuboCop for alphabetizing `zap trash` array elements
2024-01-24 21:34:18 +00:00
Issy LongandGitHub 1b5fa172bb Split audit_synced_versions_formulae checks into reusable methods
- This way we can use them in the audit and in `bump`.
2024-01-24 14:01:01 +00:00
Issy Long 00b47d1fec Teach brew style about docs/.rubocop.yml
- Yes, we have yet another `.rubocop.yml` but in-line exclusions in
  `<span class="display:none;">` in the Markdown seemed more ugly.
- This needed tweaks to `brew style` to make it read the new config
  file when we're scanning docs.
2024-01-24 00:01:45 +00:00
Issy Long e5ae67f906 Fix RuboCop FormulaAudit/ group offenses for docs code examples 2024-01-24 00:01:44 +00:00
Issy Long 9b6903f50b Fix RuboCop Style/ group offenses in docs example code 2024-01-24 00:01:43 +00:00