homebrew-fund

"brew fund" helps you fund the upstream development of your favorite Homebrew packages

MIT License

Stars
2

homebrew-fund

[!WARNING] 🚧 This is a WORK IN PROGRESS. It may not work. It may break your brew. It may provide incorrect funding links. Don't trust it until 1.0.0.

Homebrew-fund provides a Homebrew command brew fund that helps you fund the upstream development of your favorite Homebrew packages by suggesting where the package collects donations or other financial support.

brew fund came out of Homebrew/brew#15890.

Installation

Simply tap this repository:

brew tap colindean/fund

Usage

Run brew fund for online help, but normal usage is to pass a package in particular, e.g.

brew fund curl

will show potential places to fund the development of curl.

Caveats

Homebrew-fund uses a series of heuristics to suggest possible donation methods for a package. Donation methods may change. The heuristic could be wrong.

[!IMPORTANT] You are solely responsible for validating that payments made through any facility go to the intended recipient.

Heuristics

[!WARNING] Until 1.0.0, check the code, as this list may be outdated.

In general, Homebrew-fund will always attempt to retrieve the least amount of data in order to make a reasonable guess at the right URL(s) to provide.

  1. πŸŒ— A hardcoded URL for projects that aren't Homebrew packages specifically, such as Homebrew itself.
  2. πŸŒ— If the project has a GitHub homepage or download link,
    use the GitHub GraphQL API to retrieve the project's funding links,
    configured in FUNDING.yaml in a few known places.
    You may need to set a GITHUB_TOKEN or HOMEBREW_GITHUB_API_TOKEN environment variable to use this API.
  3. πŸŒ‘ Download the source archive and…
    1. πŸŒ‘ Look for files such as FUNDING.yml, DONAT{E|IONS}{.md,.adoc,.txt}, etc.
    2. πŸŒ‘ Look for a Donations section in a README{.md,.adoc,.txt}
  4. πŸŒ‘ Scrape the homepage for links to
    1. πŸŒ‘ A /donate or /donations link
    2. πŸŒ‘ Well-known donations pages, such as those documented in the FUNDING.yml spec.

Completion indicated by moon phases:

Icon Meaning
πŸŒ‘ Not started
🌘 Started
πŸŒ— Almost there, not thoroughly tested
πŸŒ• Working as brightly as the moon in the clear night sky… which means it sometimes might not
🌝 Feature complete and should always be working

Contributing

Contributions are welcome. Please consider opening an issue to describe what you'd like to do before doing it. I prize code submissions, but I really have to understand them to accept them.

Getting started

This repository defines a DevContainers configuration that loads well in GitHub Codespaces and VSCode/VSCodium.

Run make deps check test with Homebrew's Ruby pre-installed, and it should be ready to go. If you use the DevContainer, it already is.

Tests

Tests can be run with make test.

Add tests to keep coverage above 70%. Once the app is 1.0, we'll ratchet coverage up toward 100%.

Copyright

Copyright (c) 2023 Colin Dean. See LICENSE for details.