{"record":{"id":"18b35923ff04d1f5","repo":"jdx/mise","slug":"cask-has-no-url","errorCode":null,"errorMessage":"cask has no URL","messagePattern":"cask has no URL","errorType":"validation","errorClass":"RuntimeError","httpStatus":null,"severity":"error","filePath":"src/system/packages/brew/tap_cask_metadata.rb","lineNumber":294,"sourceCode":"    when :or_newer then host >= target\n    else host.same_release?(target)\n    end\n  end\n  private :macos_condition_matches?\n\n  def name(*) = nil\n  def desc(*) = nil\n  def homepage(*) = nil\n  def livecheck(*) = nil\n  def caveats(*) = nil\n  def container(*) = nil\n  def deprecate!(**) = nil\n  def disable!(**) = nil\n  def no_autobump!(*) = nil\n\n  def to_h\n    raise \"cask has no version\" if @version.nil?\n    raise \"cask has no URL\" if @url.to_s.empty?\n    {\n      \"token\" => @token,\n      \"version\" => @version.to_s,\n      \"auto_updates\" => @auto_updates,\n      \"url\" => @url,\n      \"sha256\" => @sha256,\n      \"artifacts\" => @artifacts,\n      \"depends_on\" => {\n        \"formula\" => @formula_dependencies,\n        \"cask\" => @cask_dependencies\n      },\n      \"conflicts_with\" => { \"cask\" => @conflicting_casks },\n      \"ruby_source_path\" => ENV.fetch(\"MISE_BREW_SOURCE_PATH\"),\n      \"ruby_source_checksum\" => { \"sha256\" => ENV.fetch(\"MISE_BREW_SOURCE_CHECKSUM\") },\n      \"tap_git_head\" => ENV.fetch(\"MISE_BREW_TAP_COMMIT\")\n    }\n  end\n","sourceCodeStart":276,"sourceCodeEnd":312,"githubUrl":"https://github.com/jdx/mise/blob/533346cc374382b41ec5ff70536252b2e96e725c/src/system/packages/brew/tap_cask_metadata.rb#L276-L312","documentation":"Raised by CaskMetadata#to_h when the parsed cask has a version but the url stanza is missing or empty. mise needs the download URL to build its brew-source install plan, so metadata serialization is aborted when the cask provides no URL. This fires after the version check, meaning the cask parsed far enough to have a version but never set @url.","triggerScenarios":"Cask defines no url stanza (version-only or livecheck-style cask); url is set inside a conditional stanza (on_macos/on_arch) that did not run; a DSL variant for url that the shim does not recognize, so it fell through to an ignored path.","commonSituations":"`url :homebrew_cask` placeholder URLs; platform-conditional URLs where the host condition in the shim differs from the cask's expectation; newer cask URL DSL options unsupported by the shim.","solutions":["Ensure the cask declares a concrete https url stanza","Extend the shim to handle the URL construct the cask uses (conditional or DSL variant)","Update mise for newer cask DSL support","Pin the cask to a revision with a plain url stanza"],"exampleFix":"# before (cask)\ncask \"foo\" do\n  version \"1.2.3\"\nend\n# after (cask)\ncask \"foo\" do\n  version \"1.2.3\"\n  url \"https://example.com/foo-1.2.3.dmg\"\n  sha256 \"abc123...\"\nend","handlingStrategy":"validation","validationCode":"raise \"cask has no url stanza\" unless cask_source.match?(/^\\s*url\\s+[\"']/)","typeGuard":"def has_url?(metadata) = !metadata.url.to_s.empty?","tryCatchPattern":"begin\n  metadata = parse_cask_metadata(cask_source)\nrescue RuntimeError => e\n  raise unless e.message == \"cask has no URL\"\n  warn \"cask #{token} lacks a URL; skipping\"\nend","preventionTips":["Require a plain https url stanza in the casks you consume","Avoid placeholder URLs like url :homebrew_cask","Verify conditional URL stanzas resolve for the target OS/arch before relying on the cask"],"tags":["ruby","cask","metadata","missing-field"],"backgroundTag":"empty-required-field","analyzedSha":"533346cc374382b41ec5ff70536252b2e96e725c","analyzedAt":"2026-09-17T13:35:38.149Z","contentChangedAt":"2026-09-17T13:35:38.149Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}