I ran `brew livecheck` today to check the packages in my watchlist
and realized that it wasn't checking one package because I had added
a trailing comment after the name (and `package # Comment` isn't a
valid package name). I thought we had added support for trailing
comments when we originally added comment support years back but I
must have been mistaken.
This adds support for trailing comments in livecheck watchlist files
as part of refactoring the watchlist line parsing logic to only use
one pass (instead of multiple `#map` and `#reject` calls). This
maintains the existing behavior, where blank lines and lines starting
with `#` are skipped, but does so in a more flexible manner. For
example, the existing logic wouldn't skip a comment line that has one
or more spaces before the `#` character but this new logic will
correctly skip it.
On the [beta Bluefin LTS](https://docs.projectbluefin.io/lts), `brew config` reports:
```console
OS: CentOS Stream release 10 (Coughlan)
```
This is due to the `/etc/redhat-release` file being prioritized over `::OS_VERSION` (`PRETTY_NAME` from `/etc/os-release`).
On Bluefin LTS, `PRETTY_NAME` is `Bluefin LTS`.
This commit reverses the order so `brew config` has better detection:
```
OS: Bluefin LTS
```
I tested on RHEL 10 and the OS line only changed in that the word
"release" was omitted:
```
$ cat /etc/redhat-release
Red Hat Enterprise Linux release 10.0 (Coughlan)
$ grep PRETTY_NAME /etc/os-release
PRETTY_NAME="Red Hat Enterprise Linux 10.0 (Coughlan)"
```
- This is an improvement on my previous PR https://github.com/Homebrew/brew/pull/15788
We have some formulae and casks that contain both `deprecate!` and
`disable!` calls, presumably as a way of controlling the deprecation
behavior before the disable date is reached. However, once the disable
date has been reached, `Livecheck::SkipConditions` continues to skip
the package as deprecated instead of disabled. This isn't a functional
issue as the package is still skipped but it isn't accurate because
it's not being skipped as disabled.
This reorders `FORMULA_CHECKS` and `CASK_CHECKS` to run the disabled
check before the deprecated check, so the disable date will take
precedence when it's been reached.
This removes the temporary `audit_download_strategy` exception for
the `lsr` formula. This was necessary to be able to merge support for
tangled.sh Git URLs, as it made the `using: :git` argument in the
`lsr` formula redundant and caused the "formula audit" check to fail
in brew CI.
This is a temporary workaround to allow us to merge support for
tangled.sh Git URLs in `DownloadStrategyDetector`, as it makes the
`using: :git` argument in the `lsr` formula redundant and causes brew
CI to fail. We can't remove that argument from the formula until the
brew change is merged, so this allows us to do so. This should be
removed after the brew change is available in a release.
Co-authored-by: Carlo Cabrera <github@carlo.cab>
We have one formula (`lsr`) that uses a tangled.sh URL but they don't
support a .git extension, so it isn't detected as a Git URL by
`DownloadStrategyDetector`. We can use `using: :git` with the `stable`
URL but livecheck can't use the `Git` strategy for tangled.sh URLs
because its `match` method depends on `DownloadStrategyDetector`
detecting the URL as a `GitDownloadStrategy`.
This adds support for tangled.sh URLs to `DownloadStrategyDetector`
to address this issue. This will also allow us to remove/omit the
`using: :git` argument from related URLs.
We shouldn't assume that the visibility of a tap keeps unchanged by
storing it into `TapConfig`. Instead, let's actively check that to avoid
e.g. collecting unwanted analytics.
Also, speed up the check for known official public taps so that we don't
waste our GitHub API token limit in CI.