18 Commits

Author SHA1 Message Date
botantony
68f8798821
zig std args: apply -fno-rosetta on macs with arm 2025-02-21 19:10:41 +01:00
botantony
c5d78f3347
zig std args: use symbols for compilation options 2025-02-21 17:07:29 +01:00
botantony
bfdfdc9489
-fno-rosetta flag 2025-02-21 16:49:11 +01:00
Mike McQuaid
eab322946a
formula: fix alias/generic/prepend std_cmake_args issue.
Seen in:
https://github.com/Homebrew/homebrew-core/pull/191090#issuecomment-2363215204

There's a missing signature issue here due to the `generic_*` aliasing
we're doing. With prepend, though: this is no longer needed and we can
use `super` instead which is more idiomatic and nicer overall.

This pattern should probably be applied in other places but: let's try
this targetting fix for here first.
2024-09-20 13:01:42 +01:00
Douglas Eichelberger
61985bc7f3 Use top-level OS instead 2024-09-19 10:58:53 -07:00
Douglas Eichelberger
bb80f063dc Fix namespacing 2024-09-19 10:58:53 -07:00
Douglas Eichelberger
27e951c408 Replace undef with prepended modules 2024-09-19 10:58:53 -07:00
Douglas Eichelberger
70b072a7d0 Suppress sorbet type errors when using `undef' 2024-08-15 08:03:45 -07: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
Issy Long
0e81efcccb
sorbet: Comment more files that can't be strict because of undef
- Found with
  `grep -rL "# typed: strict" Library/Homebrew | xargs grep -l "undef "`.
- This stops people from trying to bump them and
  getting an error that they can't fix because
  [it's a Sorbet limitation](https://sorbet.org/docs/error-reference#3008),
  wasting contributor time.
2024-08-09 18:23:00 +01:00
Mike McQuaid
ea2892f8ee
brew.rb: handle missing args. 2024-03-07 16:20:20 +00:00
Rylan Polster
8704e79cc0
Separate MacOS references 2023-11-15 18:19:39 -05:00
apainintheneck
c073cf901a search: show results by platform
This means that formulas that are only available on one
OS should only show up in the search results for the platform.
2023-03-27 20:04:57 -07:00
Seeker
a2af19360b extend: add on_os (for on_macos/on_linux) 2020-12-07 10:36:51 -08:00
Markus Reiter
0184e271d8 Fix RuboCop offenses. 2020-11-17 11:09:55 +01:00
Michka Popoff
8b85ef2e88 formula: add on_linux and on_macos blocks
for install and others
2020-11-03 22:54:07 +01:00
Markus Reiter
24ae318a3d Move type annotations into files. 2020-10-10 14:59:39 +02:00
Michka Popoff
c7927f5af5 formula: add linux and macos only function blocks 2020-04-12 23:51:41 +02:00