cask_language_reference/stanzas/url.md: refine comment rules #18051
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Note: In this context, I’m referring to audit as the process of manually checking a cask for correctness, not
brew cask audit
.While working on #17498 and #17499, I came to the realisation I was working on the wrong solution to the right problem. The right solution involves a slight rethink of the previous comment rule.
Our current method of informing a
url
was verified (by pointing out only the host) is insufficient and flawed, as it does not account for maintainer inattention. While for cases likeworld-of-tanks
it is pretty straightforward, since the company owns both domains, the rule is particularly ineffective for popular hosts likeamazonwas.com
andcloudfront.net
, where the host isn’t sufficiently identifiable to any application.# bitbucket.org is the official download host per the vendor homepage
isn’t enough to prove maintainers kept the comment up to date withurl
changes (what if at a certain point a contribution changed the bitbucket account to a malicious one and a mistake was made in merging?).# bitbucket.org/luisangelsm/yacreader was verified as official when first introduced to the cask
is, however, clear in this regard, as is# rink.hockeyapp.net/api/2/apps/6ab08fb043a94f51c9109c216e295a50 was verified as official when first introduced to the cask
. In those examples, discrepancies between the comment andurl
would be catchable to a user auditing the cask, signalling a mistake in need of correction.github.io
links would also no longer be exempt from the rule.With that in mind, the rule template for the comment ought then to be:
Where
URL_SECTION
is the smallest possible portion of the URL, including and following the top domain host, that uniquely identifies the app or vendor.So what about
appcast
comments (the whole point of #17499 and half of #17498)? While working on the aforementioned issues, I also realised appcast hosts are irrelevant, since they do not pose a threat to users, only maliciousurl
s do. In theory, even a third-party appcast (which is somewhat what githubreleases.atom
appcasts are) can be used just as effectively with no harm.This could only become a potential issue where
url
is extrapolated fromappcast
, but as long as the maintainer actually verified theurl
as being trustworthy, which must happen anyway, the issue no longer exists. Furthermore, this can be eliminated (almost?) completely. The reason to use urls from the appcast feed is versioning (when the website download is unversioned), but now that we’re close to having in place the system to check appcasts for updates, we can switch those to the official unversioned URLs and still haveversion
andsha256
.Things that need to be done, in order:
… per the appcast feed
comments and change the correspondingurl
to an official one found on the homepage, even if unversioned.… is the official download host per the vendor homepage
comments.github.io
homepage.