Skip to content
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

Add audit for versions containing colons or slashes. #14616

Merged
merged 1 commit into from Feb 15, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
12 changes: 12 additions & 0 deletions Library/Homebrew/cask/audit.rb
Expand Up @@ -228,6 +228,18 @@ def audit_description
add_warning "Cask should have a description. Please add a `desc` stanza." if cask.desc.blank?
end

sig { void }
def audit_version_special_characters
return unless cask.version

return if cask.version.latest?

raw_version = cask.version.raw_version
return if raw_version.exclude?(":") && raw_version.exclude?("/")

add_error "version should not contain colons or slashes"
end

sig { void }
def audit_no_string_version_latest
return unless cask.version
Expand Down