mxcl/homebrew — pull request #10671 by mistydemeo (2012-03-04 04:40:43+00:00)
Title: Proposal: brew-commit-test

I noticed that we've had a few pushes lately which included some syntax or other errors, usually in large batches of edits where it wasn't convenient to individually test every formula.

I put together this command to simplify automated testing of commits before pushing. It goes through every formula that's been changed between the newest commit on the branch you're on and origin/master, and attempts to load and test each of them to pick up errors. A few notes:

* This only covers formulae. For practical reasons, it wasn't as feasible to automatically test core changes with a generic test. (We should beef up our unit tests for that!)
* Ruby's lazy evaluation of methods means this won't pick up *every* problem - for instance, problems in `install` methods won't be detected. (You'd need to actually run the method for that.) However, everything else should be.