Skip to content

Conversation

@yutaIMD
Copy link
Contributor

@yutaIMD yutaIMD commented Nov 2, 2025

Important: Do not tick a checkbox if you haven’t performed its action. Honesty is indispensable for a smooth review process.

In the following questions <cask> is the token of the cask you're submitting.

After making any changes to a cask, existing or new, verify:

Additionally, if adding a new cask:

  • Named the cask according to the token reference.
  • Checked the cask was not already refused (add your cask's name to the end of the search field).
  • brew audit --cask --new <cask> worked successfully.
  • HOMEBREW_NO_INSTALL_FROM_API=1 brew install --cask <cask> worked successfully.
  • brew uninstall --cask <cask> worked successfully.

Comment on lines 18 to 20
strategy :page_match do |page|
page.scan(/V(\d+(?:\.\d+)+)/i).flatten.first
end
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
strategy :page_match do |page|
page.scan(/V(\d+(?:\.\d+)+)/i).flatten.first
end
regex(V(\d+(?:\.\d+)+)/i)

We will need a regex that is more closely anchored to a url or something, not just any number after "V". But you also don't need to do block here.

sha256 :no_check

on_arm do
url "https://cdn.cloud-platform.anycubic.com/file/2025/09/28/dmg/68d905e851e28229897aa0a118a4ba56/codesign_20250928_152423_AnycubicSlicerNext_arm64.dmg"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are a lot of variable parts in this url that will change between versions, these will need to be captured somehow and stored in the version, so that the cask can be updated systematically.

@p-linnane p-linnane requested a review from samford November 3, 2025 17:43
Comment on lines +19 to +30
latest_version_block = page.match(%r{<h3 class="toc-header"[^>]*>.*?V?(\d+(?:\.\d+)+)</h3>.*?<ul>(.*?)</ul>}m)
next if latest_version_block.blank?

version = latest_version_block.captures[0]
links_html = latest_version_block.captures[1]

arm_url_match = links_html.match(/href="([^"]*?arm64\.dmg)"/)
intel_url_match = links_html.match(/href="([^"]*?x86_64\.dmg)"/)

next if arm_url_match.blank? || intel_url_match.blank?

version
Copy link
Member

@samford samford Nov 3, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I shouldn't have to point this out but this does not include the URL parts in the returned version string.

This regex is used to match the version parts, so it should be set using a regex() call and passed into the strategy block (not inline in the strategy block).

This is also capturing the full href attributes for the arch-specific files instead of capturing only the distinct parts from each URL that will vary. To say the least, this isn't doing what was asked in #234863 (comment). There are many examples in existing casks that you can refer to for inspiration (e.g., sq-mixpad).

Besides that, we use match[1] instead of match.captures[0] (for the sake of brevity), so this doesn't adhere to typical strategy block code patterns. Again, there are thousands of existing strategy blocks for you to refer to (some are better than others but typical patterns start to become clear after looking through a few).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants