5284 Commits

Author SHA1 Message Date
JBYoshi
9fedaee462
Only keep empty directories when the new version also has them. 2023-04-08 16:13:12 -05:00
Markus Reiter
c516870094
Merge pull request #15168 from reitermarkus/api-ruby-source-path
Add source paths to API.
2023-04-08 09:26:27 +02:00
Issy Long
da734a30c2
Say yes to RuboCop's DisplayCopNames; fix test expectations
- Fixing the test expected output was unbelievably tedious.
- There's been debate about this setting being `false` but in
  https://github.com/Homebrew/brew/pull/15136#issuecomment-1500063225
  we decided that it was worth using the default since RuboCop behaviour changed
  so we'd have had to do some horrible things to keep it as `false` -
  https://github.com/Homebrew/brew/pull/15136#issuecomment-1500037278 -
  and multiple maintainers specify the `--display-cop-names` option to
  `brew style` themselves since it's clearer what's gone wrong.
2023-04-07 19:14:07 +01:00
Mike McQuaid
63d8de3600
brew style --fix 2023-04-07 19:10:22 +01:00
Carlo Cabrera
a754b6d343
Merge remote-tracking branch 'origin/master' into test-runners 2023-04-07 22:26:05 +08:00
Carlo Cabrera
5b8ead7bc8
Add more tests
Also, remove most integration tests, because they're slow.
2023-04-07 22:21:46 +08:00
Issy Long
dcc44f164d
Merge pull request #15105 from issyl0/cask-audit-only-failures-default
audit: Make `--display-failures-only` the default for Casks
2023-04-07 14:43:51 +01:00
Markus Reiter
844db75361
Add source paths to API. 2023-04-07 15:20:01 +02:00
Carlo Cabrera
4c33d85172
test_runner_formula: update tests
- also test `#compatible_with?`
- check that we're not simulating a system after `#dependents` is called
2023-04-07 19:31:24 +08:00
Carlo Cabrera
f9cc563e91
test_runner_formula: add tests 2023-04-06 21:03:58 +08:00
Markus Reiter
fbf474a3fd
Add curl_head method. 2023-04-06 10:22:24 +02:00
Issy Long
d636d2de37
Apply suggestions from review comments
- Rename `strictish` to `strict_only` in `add_error` method.
- Return just `errors`, a Set, not `{ errors: errors }`, a Hash,
  from `Auditor.audit`.
2023-04-06 00:10:28 +01:00
Carlo Cabrera
87373ff12a
Move more code out of dev-cmd 2023-04-06 02:13:15 +08:00
Carlo Cabrera
ffcc4cd75f
Merge remote-tracking branch 'origin/master' into test-runners 2023-04-05 23:55:01 +08:00
Mike McQuaid
e12ca4cee6
Merge pull request #15152 from dduugg/version-compare 2023-04-05 11:40:03 +01:00
Mike McQuaid
3404767cd0
Merge pull request #15154 from apainintheneck/cop-to-prevent-bin-in-service-blocks 2023-04-05 11:35:33 +01:00
apainintheneck
70451ea7b1 Add cop to stop bin in service block
The preferred method is opt_bin because that works
with the API and is more portable (works between versions).

Also removed the last example from the docs of `bin/"name"`
from the service block section
2023-04-04 20:00:30 -07:00
Douglas Eichelberger
ba2d18db36 brew style --fix 2023-04-04 18:14:54 -07:00
Douglas Eichelberger
29f93fb6f2 Add tests 2023-04-04 18:14:54 -07:00
JBYoshi
dcc4ae76e8
Also keep app directories with "brew reinstall". 2023-04-04 11:36:27 -05:00
Issy Long
7cfa544aec
cask/utils: Make more noise when encountering undefined methods
- https://github.com/Homebrew/homebrew-cask/actions/runs/4608585102/jobs/8144571098
  introduced syntax errors for the `mattermost` cask (`autoupdates`
  instead of `auto_updates`), but CI didn't fail so we didn't notice
  until it shipped to users and broke `brew update`.
2023-04-04 17:08:54 +01:00
Carlo Cabrera
5194e5c65e
Check for --eval-all before using HOMEBREW_EVAL_ALL 2023-04-05 00:03:58 +08:00
Mike McQuaid
41e7ee7b51
Merge pull request #15125 from issyl0/rubocops-cask-verified-url-with-path-ending-slash
rubocops/cask: Ensure that "verified" URLs with paths end with "/"
2023-04-04 16:30:09 +01:00
JBYoshi
5c9fa845a8
Add unit test for upgrading. 2023-04-04 10:22:45 -05:00
Issy Long
7bb20a3b83
Skip if the URL stanza has only two path components
https://github.com/Homebrew/homebrew-cask-fonts/pull/7336#discussion_r1156325651
2023-04-04 16:11:44 +01:00
Carlo Cabrera
506f6c81a7
Support --dependents flag on macOS 2023-04-04 16:20:37 +08:00
Carlo Cabrera
c125079d0f
determine-test-runners: allow usage on macOS without --dependents 2023-04-04 13:54:35 +08:00
Carlo Cabrera
3d03d243a4
determine-test-runners: test failure modes (again) 2023-04-04 13:25:44 +08:00
Carlo Cabrera
e191dbfb9e
Improve style 2023-04-04 13:20:03 +08:00
Carlo Cabrera
7ff2382d74
determine-test-runners: fix parallel tests
Since these tests run in parallel, we want to minimise our reliance on
environment variables. Also, we need to make sure that different
examples write to different paths.
2023-04-04 12:16:54 +08:00
Carlo Cabrera
4cb50a38c7
Improve versioned macOS test 2023-04-04 02:42:14 +08:00
Carlo Cabrera
839b7d44cc
determine-test-runners: test failure modes 2023-04-04 02:30:13 +08:00
Carlo Cabrera
3d7d4c60f7
determine-test-runners_spec: hardcode fewer things 2023-04-04 02:13:35 +08:00
Carlo Cabrera
3dc66fae9f
determine-test-runners: add non-trivial tests 2023-04-04 01:46:33 +08:00
Carlo Cabrera
140e751ec6
Fix brew style 2023-04-04 01:12:05 +08:00
Carlo Cabrera
d5dc9ee5e0
determine-test-runners: test --dependents 2023-04-04 01:02:47 +08:00
Carlo Cabrera
4dc370ca24
Add some more tests 2023-04-04 00:45:54 +08:00
Carlo Cabrera
ae63b23472
determine-test-runners: add a test
I'll add more substantial tests shortly, but let's start with this one.
2023-04-03 22:42:00 +08:00
Mike McQuaid
a88397096d
Merge pull request #15121 from singingwolfboy/pip-no-build-isolation
Python: allow --no-build-isolation for pip install
2023-04-03 13:14:19 +01:00
Issy Long
28f8cbe8da
Handle when the URL has interpolation: use source not str_content
- We see this a lot in real Casks.
2023-04-02 23:39:43 +01:00
Issy Long
41c35986f8
Simplify the 'should not start with https?://' message wording
Co-authored-by: Markus Reiter <me@reitermark.us>
2023-04-02 22:43:57 +01:00
Issy Long
21da074346
Only 'verified' stanzas with 0 or >1 path components should end with "/"
Handle good things like:

```ruby
url "https://example.org/download",
    verified: "example.org/download" # This is fine.
```

And bad things like:

```ruby
url "https://example.org/",
    verified: "example.org" # This should end with a slash.
```
2023-04-02 22:26:23 +01:00
Issy Long
17c0eaab25
Fix indentation of verified in url stanza examples 2023-04-02 16:41:29 +01:00
Issy Long
b586d97f84
rubocops/cask: Ensure that "verified" URLs with paths end with "/"
- These were being fixed manually[1], so let's make a RuboCop for any
  further occurrences since this is a good rule to enforce[2].

[1] - https://github.com/Homebrew/homebrew-cask/pull/144179#issuecomment-1489857249
[2] - https://github.com/Homebrew/homebrew-cask/pull/80965#issuecomment-616232313
2023-04-02 15:29:53 +01:00
David Baumgold
64ff386744 fix tests 2023-04-01 14:32:27 +02:00
David Baumgold
38a2703aa7 Python: allow --no-build-isolation for pip install 2023-04-01 11:31:29 +02:00
apainintheneck
39092fa629 service: handle string run cmd
This was not handled at all during deserialization.
The string argument gets turned into an array internally
but we skip that to preserve all args in the @run_params
variable. That means that we have to handle strings when
deserializing too.
2023-03-31 20:33:21 -07:00
Issy Long
df8e97fef6
Consolidate add_{warning,error} methods into one
- Specify `strictish: true` in `add_error` to specify that it's not a
  super big critical error.
- These will be shown only if `brew audit --strict` is requested.
2023-04-01 01:56:47 +01:00
Issy Long
2b8127d518
Turn cask warnings into errors when --strict is passed (or implied)
- Ignore them and don't show them otherwise.
- Part three of issue 15074:
  > As a result, I propose that all current cask audit warnings are never
  > displayed as warnings but the underlying audit checks turned into
  > errors displayed only with --strict (or one of the other relevant
  > flags).
2023-04-01 01:56:46 +01:00
Issy Long
a4e8f9e22b
audit: Make --display-failures-only the default for Casks
- Cask warnings are really noisy and numerous. Let's only show them if
  the user passes `--strict` or something implying `--strict`, like
  `--new-cask`.
- Additionally remove `display_passes` since we would like silence if
  nothing is wrong with the cask, the same as with formula audits.
2023-04-01 01:56:45 +01:00