Skip to content

Commit

Permalink
Merge pull request #10894 from reitermarkus/mandatory-livecheck
Browse files Browse the repository at this point in the history
Make `livecheck` audit mandatory for versioned casks.
  • Loading branch information
reitermarkus committed Mar 23, 2021
2 parents 1e55837 + 41fec99 commit 3c6a7b3
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions Library/Homebrew/cask/audit.rb
Expand Up @@ -546,12 +546,20 @@ def check_download

def check_livecheck_version
return unless appcast?
return unless cask.livecheckable?
return if cask.livecheck.skip?
return if cask.version.latest?

latest_version = Homebrew::Livecheck.latest_version(cask)&.fetch(:latest)
return if cask.version.to_s == latest_version.to_s
if cask.version.to_s == latest_version.to_s
if cask.appcast
add_error "Version '#{latest_version}' was automatically detected by livecheck; " \
"the appcast should be removed."
end

return
end

return if cask.appcast && !cask.livecheckable?

add_error "Version '#{cask.version}' differs from '#{latest_version}' retrieved by livecheck."
end
Expand Down

0 comments on commit 3c6a7b3

Please sign in to comment.