5284 Commits

Author SHA1 Message Date
Issy Long
f682147598
Fix RuboCop Style/RedundantFreeze offenses 2024-01-18 22:20:01 +00:00
Bo Anderson
ec0434c549
Tweak library load path insertion to be as early as possible 2024-01-18 14:54:14 +00:00
Issy Long
0e27dc2564
Fix RuboCop Style/ArrayIntersect offenses 2024-01-18 14:11:43 +00:00
Issy Long
e4b4af4c45
Add a failing test for comments moving with the alphabetization 2024-01-14 21:32:50 +00:00
Issy Long
2c9e6e425b
Autofix Cask/ArrayAlphabetization offenses in test fixtures 2024-01-14 20:57:08 +00:00
Michael Cho
b4657e1eef
rubocops/components_redundancy: stable/head block removal
When a `stable do` or `head do` block only contains `url`, `sha256`,
`mirror`, and/or `version`, then the block should be removed.
2024-01-12 19:07:10 -05:00
Mike McQuaid
724e14ee25
formula_auditor: split audit_revision_and_version_scheme.
Separate this into two methods so we can have separate skips for each.
2024-01-12 14:18:00 +00:00
Douglas Eichelberger
0852e1d7b6 Refactor away String#indent 2024-01-08 13:36:45 -08:00
Bo Anderson
43e5352074
test/requirement_spec: use stub_const 2024-01-08 18:41:32 +00:00
Patrick Linnane
50b0940c72
various: fix future tense in tests
Co-authored-by: Bo Anderson <mail@boanderson.me>
2024-01-08 18:41:30 +00:00
Patrick Linnane
a0f6b9358f
test/hardware/cpu_spec: add M3 values 2024-01-05 15:37:33 -08:00
Issy Long
9070f6d829
Check uninstall too, avoiding arrays containing commands 2024-01-02 23:31:13 +00:00
Bo Anderson
e466417cdf dependency: cleanup unused code 2024-01-02 17:48:29 +00:00
Bo Anderson
5aebde3ffd Add consistent path validation 2024-01-01 18:37:47 +00:00
Michael Cho
2f3f017a6e
rubocops/uses_from_macos: audit when depends_on :linux 2023-12-30 18:30:05 -05:00
Douglas Eichelberger
caf8259ae6 Code review changes 2023-12-27 15:29:33 -08:00
Douglas Eichelberger
3abbf4447e Some minor regexp match perf improvements 2023-12-27 13:16:36 -08:00
Issy Long
fb124f92ed
Ignore non-zap trash methods 2023-12-22 00:41:56 +00:00
Issy Long
b9f13fc35d
Better detection and replacement of non-alphabetized arrays
- Use `sort_by` to sort the array, rather than comparing each element
  to the next.
- This doesn't error with complaints about clobbering at all when run on
  `homebrew/cask`, hurray. And it also handles interpolations correctly,
  rather than ignoring them.

Co-authored-by: Bevan Kay <email@bevankay.me>
2023-12-22 00:26:38 +00:00
Issy Long
f34accfcde
Make the test expect_offense calls consistent with other tests 2023-12-22 00:20:02 +00:00
Issy Long
f4754baa00
Ignore zap trash stanzas with interpolation
- Interpolating the version into a path is a common pattern, but the interpolations
  trip up the alphabetization autocorrect quite spectacularly, so let's
  ignore them (for now?).
2023-12-22 00:19:03 +00:00
Michael Cho
3e428f7676
formula_auditor: split out checksum check 2023-12-20 10:22:26 -05:00
Mike McQuaid
4d93a50ad6
Merge pull request #16364 from cho-m/pybuild-rubocopy
rubocops/lines: consistency with single non-runtime Python
2023-12-20 11:57:17 +00:00
Rylan Polster
f61ef4be2f
Merge pull request #16351 from Rylan12/rubocop-for-cask-discontinued
Create rubocop requiring `deprecate!` over `discontinued` for casks
2023-12-19 21:00:58 -05:00
Issy Long
8cf58e36e6
Add a new RuboCop for alphabetizing zap trash array elements
- Part of issue 16323.
- Previously this was being done manually by Cask maintainers.
- While we're here, enforce that the `zap trash` path is not in `[]` if
  it only contains a single element.
- This is buggy on actual Casks, hence the draft PR.
2023-12-19 23:42:08 +00:00
Michael Cho
61b512c72c
rubocops/lines: consistency with single non-runtime Python 2023-12-19 15:20:45 -05:00
Patrick Linnane
9dee80cb2d
various: fix style errors 2023-12-18 09:34:01 -08:00
Rylan Polster
25b753fe51
Re-add some discontinued? checks for casks 2023-12-17 19:07:37 -05:00
Rylan Polster
8d8cd23414
Add rubocop to enforce deprecate! over discontinued 2023-12-17 16:49:53 -05:00
Rylan Polster
254fcf7c1f
Update livecheck test fixtures to use deprecate! and disable! 2023-12-17 16:31:04 -05:00
Rylan Polster
4793677123
Merge pull request #16292 from Rylan12/cask-deprecate-disable
Add `deprecate!` and `disable!` to casks
2023-12-17 15:03:39 -05:00
Rylan Polster
40d3ab6a5d
Add tests and fix brew typecheck 2023-12-16 20:01:47 -05:00
Issy Long
149b0e4f31
Fix new Style/MutableConstant RuboCop offenses for Ruby 3.1
- A follow-up to de592af20bbff5bcb548d2474f0722e59ff1129a, resetting the previous disabled comments too.
2023-12-16 11:57:06 +00:00
Sam Ford
ccbde5952d
FormulaAuditor: Separate stable version audit
The "stable version should not decrease" formula audit currently
prevents us from being able to create bottles when downgrading a
formula version. We previously worked around this by bumping
`version_scheme` but this wasn't an intended use case and we now
avoid using it for this purpose.

We can handle simple formula downgrades by reverting changes in a
syntax-only PR but that isn't sufficient when we need new bottles
(i.e., if additional changes have been made to the formula in the
interim time). In the latter case, the only available solution may be
to revert all changes made after the previous version using a
syntax-only PR and then create another PR to reintroduce the other
changes and create new bottles.

To avoid the aforementioned approach, this splits the stable version
audit into a separate method, so we can use `brew audit
--except=stable_version` to selectively skip it.
2023-12-15 17:27:01 -05:00
Bo Anderson
89531e9ff3
Update all dependencies 2023-12-15 16:24:46 +00:00
Bo Anderson
5692c8ecbf
Fix style violations under newer RuboCop 2023-12-14 05:47:12 +00:00
Mike McQuaid
79a6091d08
Cask#full_name: properly output Homebrew org names
This was not returning the full name correctly for e.g. anything in
Homebrew/homebrew-fonts.

While we're here, fix up a few other places where `tap.core_cask_tap?`
can be used more appropriately.
2023-12-13 13:17:12 +00:00
Bo Anderson
688d87e839
Remove Ruby 2.6 & macOS system Ruby support code 2023-12-12 03:44:31 +00:00
Eric Knibbe
77c23df526
dependency: disable renamed formula warning 2023-12-11 14:14:52 -05:00
Bo Anderson
b42256d286
Deprecate, disable & delete code for Homebrew 4.2.0 2023-12-07 23:42:13 +00:00
Bo Anderson
246a73b644
test: fix a couple failures on certain systems 2023-12-07 03:12:22 +00:00
Anatoli Babenia
6afd15ae00
create: Fix getting name from GitHub archives
`brew create https://github.com/lapce/lapce/archive/v0.3.0.tar.gz` was
getting the wrong name 'v3.0.0' from the URL

Co-authored-by: Mike McQuaid <mike@mikemcquaid.com>
2023-12-05 14:49:53 -05:00
Mike McQuaid
35369e1009
utils/svn_spec: change remote used in test.
GitHub is dropping their Subversion support so let's move to an Apache
Subversion server instead.
2023-12-05 14:20:12 -05:00
Francois-Xavier Coudert
7eb2134fa4 Add M3 processors 2023-12-01 15:45:06 +01:00
Douglas Eichelberger
cfb8ec8193 Add tests 2023-11-26 15:36:27 -08:00
Mike McQuaid
e93b0fc430
Merge pull request #16224 from Rylan12/remove-os-mac-on-linux
Deprecate `OS::Mac` on Linux
2023-11-23 12:40:22 +00:00
Rylan Polster
f98b8f948c
Add rubocop to remove MacOS references 2023-11-22 21:19:01 -05:00
Bo Anderson
ad2c1c9bad
test/os/mac/diagnostic: fix when env is not set 2023-11-22 01:02:46 +00:00
Sam Ford
5a3632efa4
xml_spec: Standardize XPath expressions
The XML examples used in `Xml` strategy tests is known/predictable,
so the related XPaths can be explicit instead of loose.
2023-11-17 22:34:12 -05:00
Sam Ford
9bfe423a5a
Xml: Add #element_text method
This refactors verbose code in the `Sparkle` strategy where we access
element text into a reusable `Xml#element_text` method, replacing
chained calls like `item.elements["title"]&.text&.strip&.presence`
with `Xml.element_text(item, "title")`.

`#element_text` is only used to retrieve the text of a child element
in the `Sparkle` strategy but it can also retrieve the text from the
provided element if the `child_path` argument is omitted (i.e.,
`Xml.element_text(item)`). This will allow us to also avoid similar
calls like `item.text.strip.presence` in the future.
2023-11-17 22:34:12 -05:00