17 Commits

Author SHA1 Message Date
Mike McQuaid
77c0d38c35
brew style --fix 2022-12-13 11:37:06 +00:00
Sam Ford
085827f605
Handle variable strategy block arguments
There are times where a regex isn't needed in a `strategy` block and
these changes explicitly handle that situation.

This allows the Symbol Proc format used in some `Sparkle` `livecheck`
blocks (e.g., `strategy :sparkle, &:version`) to continue working
instead of failing with a "wrong number of arguments (given 1,
expected 0)" error. This error would occur because a Symbol Proc only
only expects one argument (e.g., an `Item`, not an `Item` and a
regex/nil).

There's an argument to be made for avoiding the Symbol Proc format
for `strategy` blocks but I haven't found a way of selectively
disabling the Style/SymbolProc cop only for a `strategy` DSL method
call. That is to say, if we don't use the Symbol Proc format, `brew
style` will give a "Pass &:version as an argument to strategy instead
of a block." offense.

Besides that, this also replaces the `block` type signatures in
livecheck strategies with `T.untyped`. Sorbet doesn't know how to
handle a `Proc` with a variable number of arguments and can't be
taught how (i.e., `T.any` with a `Proc` signature for each variation
doesn't work). The aforementioned changes cause Sorbet to complain
about there being both too many and too few arguments, so the only
way to win is not to play the game. Hopefully we can restore the
`block` type signatures in the future (if upstream resolves this
years-old issue) but `T.untyped` seems to be our only option for now.
2021-11-19 23:58:55 -05:00
Sam Ford
26821301e7
livecheck: move url/regex generation into methods 2021-08-17 18:03:40 -04:00
Sam Ford
13b349b4ae
Refactor #find_versions parameters in strategies 2021-08-16 12:01:32 -04:00
Sam Ford
f2bd39ccef
Add additional method signatures to strategies 2021-08-11 19:05:59 -04:00
Sam Ford
a970780851
livecheck: allow nil return from strategy blocks 2021-08-02 18:33:34 -04:00
Markus Reiter
a210b1a04e
Add extract_plist strategy. 2021-04-07 04:58:31 +02:00
Sam Ford
2060f13de1
Refactor livecheck strategies around match regex 2020-12-31 09:18:36 -05:00
Dario Vladovic
86fee106a3
livecheck: strengthen URL patterns 2020-12-31 09:14:53 -05:00
Sam Ford
361743e1fb
Livecheck: Extend strategy block support 2020-12-25 20:31:36 -05:00
Sam Ford
ea259da9c7
Livecheck: Demodulize PageMatch name in calls
Co-authored-by: Markus Reiter <me@reitermark.us>
2020-12-24 11:15:57 -05:00
Sam Ford
1c8022ef48
Pypi: Update page_url to avoid redirection 2020-12-13 16:21:37 -05:00
EricFromCanada
3768b7a6e9 apidoc: update comment wording, punctuation, formatting 2020-11-06 00:21:02 -05:00
Markus Reiter
24ae318a3d Move type annotations into files. 2020-10-10 14:59:39 +02:00
Dustin Rodrigues
16d4f51a84 livecheck/pypi: minor edit to PyPI post version 2020-10-02 22:01:35 -04:00
Dustin Rodrigues
6735debcd4 livecheck/pypi: allow post in pypi version 2020-10-02 01:13:51 -04:00
nandahkrishna
f520301180
livecheck migration: add strategies
Co-authored-by: Sam Ford <1584702+samford@users.noreply.github.com>
Co-authored-by: Thierry Moisan <thierry.moisan@gmail.com>
Co-authored-by: Dawid Dziurla <dawidd0811@gmail.com>
Co-authored-by: Maxim Belkin <maxim.belkin@gmail.com>
Co-authored-by: Issy Long <me@issyl0.co.uk>
Co-authored-by: Mike McQuaid <mike@mikemcquaid.com>
Co-authored-by: Seeker <meaningseeking@protonmail.com>
2020-08-27 20:00:30 +05:30