Merge pull request #10344 from vitorgalvao/no-github-appcast-audit

Cask: audit: Do not require appcast on GitHub releases
This commit is contained in:
Mike McQuaid 2021-01-19 08:41:29 +00:00 committed by GitHub
commit 33dafa4498
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 0 additions and 41 deletions

View File

@ -310,10 +310,6 @@ module Cask
add_appcast = "please add an appcast. See https://github.com/Homebrew/homebrew-cask/blob/HEAD/doc/cask_language_reference/stanzas/appcast.md" add_appcast = "please add an appcast. See https://github.com/Homebrew/homebrew-cask/blob/HEAD/doc/cask_language_reference/stanzas/appcast.md"
case cask.url.to_s case cask.url.to_s
when %r{github.com/([^/]+)/([^/]+)/releases/download/(\S+)}
return if cask.version.latest?
add_error "Download uses GitHub releases, #{add_appcast}"
when %r{sourceforge.net/(\S+)} when %r{sourceforge.net/(\S+)}
return if cask.version.latest? return if cask.version.latest?

View File

@ -597,18 +597,6 @@ describe Cask::Audit, :cask do
it { is_expected.not_to fail_with(message) } it { is_expected.not_to fail_with(message) }
end end
context "when the download uses GitHub releases and has an appcast" do
let(:cask_token) { "github-with-appcast" }
it { is_expected.not_to fail_with(message) }
end
context "when the download uses GitHub releases and does not have an appcast" do
let(:cask_token) { "github-without-appcast" }
it { is_expected.to fail_with(message) }
end
context "when the download is hosted on SourceForge and has an appcast" do context "when the download is hosted on SourceForge and has an appcast" do
let(:cask_token) { "sourceforge-with-appcast" } let(:cask_token) { "sourceforge-with-appcast" }

View File

@ -1,13 +0,0 @@
cask "github-with-appcast" do
version "1.0"
sha256 "a69e7357bea014f4c14ac9699274f559086844ffa46563c4619bf1addfd72ad9"
url "https://github.com/user/project/releases/download/#{version}/github.pkg"
appcast "https://github.com/user/project/releases.atom"
name "github"
homepage "https://github.com/user/project"
pkg "github.pkg"
uninstall pkgutil: "com.github"
end

View File

@ -1,12 +0,0 @@
cask "github-without-appcast" do
version "1.0"
sha256 "a69e7357bea014f4c14ac9699274f559086844ffa46563c4619bf1addfd72ad9"
url "https://github.com/user/project/releases/download/#{version}/github.pkg"
name "github"
homepage "https://github.com/user/project"
pkg "github.pkg"
uninstall pkgutil: "com.github"
end