This will allow us to play around with Copilot agents. Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2.2 KiB
2.2 KiB
Copilot Instructions for Homebrew/brew
This is a Ruby based repository with Bash scripts for faster execution.
It is primarily responsible for providing the brew command for the Homebrew package manager.
Please follow these guidelines when contributing:
Code Standards
Required Before Each Commit
- Run
brew typecheckto verify types are declared correctly using Sorbet. - Run
brew style --fixto lint code formatting using RuboCop. Individual files can be checked/fixed by passing them as arguments. - Run
brew tests --onlineto ensure that RSpec unit tests are passing (although some online tests may be flaky so can be ignored if they pass on a rerun). Individual test files can be passed with--onlye.g. to testLibrary/Homebrew/cmd/reinstall.rbwithLibrary/Homebrew/test/cmd/reinstall_spec.rbrunbrew tests --only=cmd/reinstall.
Development Flow
- Write new code (using Sorbet
sigtype signatures andtyped: strictfiles whenever possible) - Write new tests (avoid more than one
:integration_testper file for speed)
Repository Structure
bin/brew: Homebrew'sbrewcommand main Bash entry point scriptcompletions/: Generated shell (bash/fish/zsh) completion files. Don't edit directly, regenerate withbrew generate-man-completionsLibrary/Homebrew/: Homebrew's core Ruby (with a little bash) logic.Library/Homebrew/bundle/: Homebrew'sbrew bundlecommand.Library/Homebrew/cask/: Homebrew's Cask classes and DSL.Library/Homebrew/extend/os/: Homebrew's OS-specific (i.e. macOS or Linux) class extension logic.Library/Homebrew/formula.rb: Homebrew's Formula class and DSL.docs/: Documentation for Homebrew users, contributors and maintainers. Consult these for best practices and help.manpages/: Generatedmandocumentation files. Don't edit directly, regenerate withbrew generate-man-completionspackage/: Files to generate the macOS.pkgfile.
Key Guidelines
- Follow Ruby best practices and idiomatic patterns
- Maintain existing code structure and organisation
- Write unit tests for new functionality. Use one assertion per test where possible.
- Document public APIs and complex logic. Suggest changes to the
docs/folder when appropriate