-
-
Notifications
You must be signed in to change notification settings - Fork 10.2k
livecheck: add RuboCops #8643
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
livecheck: add RuboCops #8643
Conversation
Ah, I'd forgotten to mention: CI is 🔴 because of some recent updates to livecheck URLs in homebrew/core, which violate a cop this PR introduces. I'll create a PR to fix those issues. |
With the latest commit, some changes have been made:
|
The tests I added pass locally ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A few nits but otherwise looks great, nice work!
I've made all the changes @MikeMcQuaid, let me know if this is good to merge. I'll create a separate PR to address the livecheck |
brew style
with your changes locally?brew tests
with your changes locally?This PR creates an audit and adds RuboCops for livecheck.
Audit
Check whether livecheck is able to find versions (doesn't error out) for formulae with livecheck blocks defined.
RuboCops
url
,regex
, etc.url
is provided.:head
,:stable
,:homepage
).regex
es contain\.t
and not\.tgz
or\.tar\.gz
, etc.regex
is provided forstrategy :page_match
.regex
es are case-insensitive (except formulae in allowlist).regex
is enclosed within parentheses.I haven'[t included the cop for counting number of capturing groups – I wasn't able to write a regex that was able to do this, and I couldn't find a method/function to count capturing groups without matching.
The
regex
for the extension checking needs to be verified. Here's a more convoluted version I wrote that matches all possibletar
extensions (I think): https://rubular.com/r/d5uJPJIONM63VEIt is possible that I've missed some important points in this PR description, but I will answer any questions as they arise. Looking forward to your reviews and suggestions everyone. Thanks!
CC @samford