5014 Commits

Author SHA1 Message Date
hyuraku
cd0686d75b move cask/cmd/uninstall_spec to cask/uninstall_spec 2023-03-09 22:33:45 +09:00
hyuraku
38a62b3a51 repair style 2023-03-09 20:55:33 +09:00
hyuraku
2f870fa670 move cask/cmd/upgrade_spec to cask/upgrade 2023-03-09 20:41:22 +09:00
Issy Long
3a83b5492c
rubocop: Clean up Style/BlockDelimiters excludes and autofix offenses
- The defaults of using "do ... end" for multi-line blocks everywhere is
  good, better than switching everything to braces everywhere.
2023-03-08 23:54:22 +00:00
Mike McQuaid
b1801333cb
Merge pull request #14917 from dduugg/string-inflections
Remove ActiveSupport String inflections
2023-03-08 12:39:54 +00:00
Douglas Eichelberger
6ffda80a8a brew style 2023-03-07 10:14:57 -08:00
Douglas Eichelberger
544960b4fc Replace String#underscore with util 2023-03-07 10:13:38 -08:00
Douglas Eichelberger
1f742727af Move tests 2023-03-07 09:08:54 -08:00
Mike McQuaid
f4e180c40b
brew style --fix 2023-03-07 08:57:57 +00:00
hyuraku
4ab4dcdc82 repair spec style 2023-03-06 22:29:52 +09:00
hyuraku
122b24e9ff repair zap spec 2023-03-06 22:27:54 +09:00
hyuraku
e0416e0f65 add zap option spec to cask_installer spec 2023-03-06 22:27:53 +09:00
hyuraku
7c1bd961c6 remove cask/cmd/zap and cask/cmd/zap_spec 2023-03-06 22:27:53 +09:00
Mike McQuaid
9e370b0a3d
Merge pull request #14847 from dduugg/no-to_sentence
Move Array#to_sentence monkey-patch from ActiveSupport to extend/
2023-03-06 12:37:02 +00:00
Issy Long
7a334070b8
Merge pull request #14893 from issyl0/sorbet-bumps 2023-03-06 12:23:59 +00:00
Issy Long
5a68566097
Merge pull request #14886 from issyl0/rubocop-cask-url-verified-disallow-protocol 2023-03-06 12:22:22 +00:00
Issy Long
984e8d1503
Merge pull request #14877 from issyl0/rubocop-layout/multiline-method-indentation
rubocop: Enable `Layout/MultilineMethodCallIndentation` & fix offenses
2023-03-06 12:18:29 +00:00
Issy Long
6a704f2f40
sorbet: Bump more files to typed: true
- This was done through the `brew typecheck --suggest-typed --update`
  command.
2023-03-05 18:18:59 +00:00
Issy Long
d995afc000
test/rubocops/cask/url: Ensure that autocorrection works 2023-03-05 17:08:43 +00:00
Issy Long
4e067565dd
rubocops/cask/url: Fix test expectations; regexp for starts_with? 2023-03-05 16:55:47 +00:00
Issy Long
edeefebf61
utils/github: Fix double counting of author/committer numbers
- The usage of this in `brew contributions` wasn't correct for a user
  with 5 authored commits to homebrew/cask that had been committed by
  other people, the numbers would turn out as 5 authored, 5 committed.
- I decided to do this properly by getting the SHAs for author and
  committer and determine the differences between the two arrays.
  This also accounts for when authored commits are 0, or committed
  commits, or both.
- Add tests, because I don't want to fix this a third time!
2023-03-05 14:41:04 +00:00
Issy Long
79db987215
rubocops/cask: Disallow protocol in cask URL verified stanza
- Apparently the "verified" parameter in the URL (present when a Cask's
  download URL is not the same as its homepage) shouldn't have the
  protocol (`https`, `http`) at the front.
- Removing this has happened manually in the past, so here's an
  autocorrecting RuboCop for it.
2023-03-04 23:00:04 +00:00
Douglas Eichelberger
8527b01b2b Oxford commas 2023-03-03 18:07:39 -08:00
Mike McQuaid
066a8afe61
Merge pull request #14868 from samford/livecheck/add-yaml-strategy
livecheck: Add Yaml strategy
2023-03-04 00:06:11 +00:00
Issy Long
734a651f93
rubocop: Enable Layout/MultilineMethodCallIndentation & fix offenses
- Part of trying to reduce the number of `Excludes:` we have in our
  RuboCop configs.
- The fixes here all seemed reasonable, with some minimal tweaks for
  line length and less floatiness. Apart from `test/dev-cmd/bottle_spec.rb`
  where RuboCop wanted to do some ridiculously floaty indentation and there
  wasn't an obvious alternative place to break the lines, so I opted for
  in-line disables instead.
2023-03-03 22:18:51 +00:00
Douglas Eichelberger
e68b02c4a6 Move tests and requires 2023-03-03 12:44:23 -08:00
Douglas Eichelberger
9ab3cfb7a7 Add tests 2023-03-03 12:44:22 -08:00
Issy Long
61cb843cbb
Merge pull request #14871 from issyl0/rubocop-inline-disables
rubocop: Alphabetise, remove config that's default, in-line some disables
2023-03-03 12:10:14 +00:00
Mike McQuaid
8c333f4ec6
Merge pull request #14851 from hyuraku/move-cask/cmd/list-to-cask/list
Move `cask/cmd/list` to `cask/list`
2023-03-03 09:26:01 +00:00
Sam Ford
4a41f01e8b
Merge pull request #14858 from samford/livecheck/json-rework-after-xml-strategy
Json: Add #parse_json method and tidy up tests
2023-03-02 23:27:01 -05:00
Issy Long
e05cd2c542
rubocop: In-line Style/HashAsLastArrayItem disablement
- We want to move away from `Excludes:` in the main `.rubocop.yml` config file
  containing full file paths, because it's hard to track whether they're still
  necessary or not (and other occurrences in the files that you might
  legitimately want to improve are unaccounted for).
2023-03-02 22:11:05 +00:00
Sam Ford
74370fe604
ElectronBuilder: Update to use Yaml#find_versions
This updates `ElectronBuilder` to use `Yaml#find_versions`, as the
only code unique to that strategy is to restrict regex usage and
use default version-finding logic when a `strategy` block isn't
provided. This is similar to how we have various strategies that
use `PageMatch#find_versions` internally.

This allows us to remove `ElectronBuilder#versions_from_content`
entirely, along with the related tests. I've added support for
`provided_content` to `ElectronBuilder#find_versions` as a way of
adding tests and maintaining code coverage.
2023-03-02 16:23:32 -05:00
Sam Ford
33268e4fb0
livecheck: Add Yaml strategy
This adds a generic `Yaml` strategy to livecheck that requires a
`strategy` block to operate. The YAML-parsing code is taken from the
existing approach in the `ElectronBuilder` strategy.

We don't currently have any `strategy` blocks in first-party taps
that manually parse YAML. However, creating a generic `Yaml` strategy
allows us to simplify `ElectronBuilder` (and any future strategy
that works with YAML) while making it easy to create custom `Yaml`
`strategy` blocks in formulae/casks as needed.
2023-03-02 16:20:39 -05:00
Douglas Eichelberger
0384b82adc
Merge pull request #14826 from dduugg/no-open-struct
Enable Style/OpenStructUse cop
2023-03-02 12:30:28 -08:00
hyuraku
931ff309c7 move cask/cmd/list_spec to cask/list_spec 2023-03-02 21:53:15 +09:00
Sam Ford
e75ab0a26f
json_spec: Clean up tests
This renames `simple_content` to `content_simple`, which makes the
`content_*` variable name convention more consistent (as is in the
`Xml` strategy tests).
2023-03-01 17:27:33 -05:00
Sam Ford
cebb951baf
Json: Add #parse_json method
This setup mimics the `#parse_xml` method that was implemented in the
`Xml` strategy. Isolating the parsing code means that other strategies
can take only what they need from `Json` (i.e., it's not required for
them to use `Json#find_versions`).
2023-03-01 17:27:33 -05:00
Mike McQuaid
97fbd89a57
Merge pull request #14845 from samford/livecheck/add-xml-strategy
livecheck: Add Xml strategy
2023-03-01 22:21:13 +00:00
Mike McQuaid
d43824d49f
Merge pull request #14849 from bayandin/fix-alias-loading
formula: fix alias loading
2023-03-01 12:36:17 +00:00
Mike McQuaid
c0bae192e5
Merge pull request #14624 from DenizUgur/service_run_at_load
dedicated `run_at_load` property
2023-03-01 12:35:15 +00:00
Mike McQuaid
cae7aad141
Merge pull request #14713 from apainintheneck/cask-to-h-without-api
cask: `to_h` without api
2023-03-01 12:34:41 +00:00
Mike McQuaid
9296db0c41
Merge pull request #14839 from hyuraku/move-cask/cmd/info-to-cask/info
Move `cask/cmd/info` to `cask/info`
2023-03-01 12:25:26 +00:00
Alexander Bayandin
9b4f29e47c
formula: fix alias loading 2023-03-01 09:44:57 +00:00
apainintheneck
9087afba74 Add baseline test for Cask#to_h
Also, added a test for loading JSON files in the cask loader.
2023-02-28 21:43:02 -08:00
apainintheneck
c19017c6bd Make Cask#to_h work without the API
Set metadata when we load casks from the source API.

Set `@tap_git_head` manually.

Also, allow `auto_update` to receive false.
This is only done for consistency.

Stop double printing the `kext` caveat.

Handle Array elements correctly when substituting
path elements in artifacts. This affected how the
Uninstall Signal keys were evaluated (they are
represented as arrays of arrays).
2023-02-28 19:36:20 -08:00
Douglas Eichelberger
719f1d6c6e Refactor some use of OpenStruct 2023-02-28 13:05:43 -08:00
Sam Ford
7d9e1a50e8
livecheck: Add Xml strategy
This adds a generic `Xml` strategy to livecheck that requires a
`strategy` block to operate. The XML-parsing code is taken from the
existing approach in the `Sparkle` strategy. As such, `Sparkle` has
been updated to use the `Xml#parse_xml` method instead.

Unlike the `Json` strategy, we don't currently have any `strategy`
blocks in first-party taps that manually parse XML. However, we had a
user request support for something like this and I was already working
on an `Xml` strategy (as a way of extracting the XML-parsing code
from `Sparkle` into something general-purpose), so here we are.

Future strategies that parse simple XML data can potentially use the
`Xml#find_versions` method (similar to how we have strategies that
leverage `PageMatch#find_versions`) instead of having to implement
something bespoke like `Sparkle`.
2023-02-28 14:58:11 -05:00
Mike McQuaid
7c15dce285
Merge pull request #14798 from MikeMcQuaid/deprecate_shell
Deprecate `preferred_shell` and `shell_profile`.
2023-02-28 15:18:00 +00:00
Mike McQuaid
32463227ac
Deprecate preferred_shell and shell_profile.
I know that we're outside our normal deprecation cycle but: these are
totally broken with the API and it doesn't make sense to support them
only for non-core formulae.
2023-02-28 15:02:06 +00:00
hyuraku
198c6f6b8c move cask/cmd/info_spec to cask/info_spec 2023-03-01 00:01:28 +09:00