Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

dev-cmd/livecheck: improve error message when all formulae are autobumped #19201

Merged
merged 1 commit into from
Feb 3, 2025

Conversation

nandahkrishna
Copy link
Member

  • 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?

When all formulae provided to livecheck are in autobump.txt, we get an uninterpretable error message, which does not help diagnose what's going on:

➜  Homebrew git:(master) brew lc prestodb
Usage: brew livecheck, lc [options] [formula|cask ...]

Check for newer versions of formulae and/or casks from upstream. If no formula
or cask argument is passed, the list of formulae and casks to check is taken
from HOMEBREW_LIVECHECK_WATCHLIST or ~/.homebrew/livecheck_watchlist.txt.

      --full-name                  Print formulae and casks with fully-qualified
                                   names.
      --tap                        Check formulae and casks within the given
                                   tap, specified as user/repo.
      --eval-all                   Evaluate all available formulae and casks,
                                   whether installed or not, to check them.
      --installed                  Check formulae and casks that are currently
                                   installed.
      --newer-only                 Show the latest version only if it's newer
                                   than the formula/cask.
      --json                       Output information in JSON format.
  -r, --resources                  Also check resources for formulae.
  -q, --quiet                      Suppress warnings, don't print a progress bar
                                   for JSON output.
      --formula, --formulae        Only check formulae.
      --cask, --casks              Only check casks.
      --extract-plist              Enable checking multiple casks with
                                   ExtractPlist strategy.
      --autobump                   Include packages that are autobumped by
                                   BrewTestBot. By default these are skipped.
  -d, --debug                      Display any debugging information.
  -v, --verbose                    Make some output more verbose.
  -h, --help                       Show this message.

Error: Invalid usage: No formulae or casks to check.

This PR attempts to improve the messaging:

➜  Homebrew git:(livecheck-error) brew lc prestodb
➜  Homebrew git:(livecheck-error) brew lc -d prestodb
/opt/homebrew/Library/Homebrew/brew.rb (Formulary::FromNameLoader): loading prestodb
/opt/homebrew/Library/Homebrew/brew.rb (Cask::CaskLoader::NullLoader): loading prestodb
==> Skipping prestodb as it is autobumped in homebrew/core.

The "skip" message only appears when using --debug but there is definitely a case to be made for printing it regardless, or a summary that all provided formulae were ignored.

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 @nandahkrishna!

@MikeMcQuaid MikeMcQuaid added this pull request to the merge queue Feb 3, 2025
Merged via the queue into master with commit 7bf0ba0 Feb 3, 2025
28 checks passed
@MikeMcQuaid MikeMcQuaid deleted the livecheck-error branch February 3, 2025 14:06
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants