KEMBAR78
livecheck: support trailing comments in watchlist by samford · Pull Request #20623 · Homebrew/brew · GitHub
Skip to content

Conversation

samford
Copy link
Member

@samford samford commented Sep 2, 2025

  • Have you followed the guidelines in our Contributing document?
  • Have you checked to ensure there aren't other open Pull Requests for the same change?
  • Have you added an explanation of what your changes do and why you'd like us to include them?
  • Have you written new tests for your changes? Here's an example.
  • Have you successfully run brew style with your changes locally?
  • Have you successfully run brew typecheck with your changes locally?
  • Have you successfully run brew tests with your changes locally?

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.

Copy link
Member

@MikeMcQuaid MikeMcQuaid left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

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.
@samford samford force-pushed the livecheck/support-trailing-comments-in-watchlist branch from f5e354d to 31cf8b4 Compare September 3, 2025 15:16
@MikeMcQuaid MikeMcQuaid added this pull request to the merge queue Sep 3, 2025
Merged via the queue into main with commit 4343324 Sep 3, 2025
36 checks passed
@MikeMcQuaid MikeMcQuaid deleted the livecheck/support-trailing-comments-in-watchlist branch September 3, 2025 15:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants