Help! I can't get my patch committed!

Having had several patches tossed out by reviewers for various reasons, I can attest to the fact that even in the best of circumstances (the module maintainer is active and open to 3rd party code, there are other interested parties waiting to review your patch) getting a patch past peer review and committed can be an exercise in frustration. Fortunately there are two things you can do right off the bat that greatly increase your chances of getting your patch passed: run Coder on your code and write unit tests for it using Simpletest.

Coder

9 times out of 10 the first thing a potential patch reviewer is going to do after applying your patch is do code review on the newly patched module with Coder. If the patch doesn't (at minimum) pass the coding standards for normal mode in Coder, chances are it'll get thrown out and you'll get handed a laundry list of formatting changes to make.

For extra credit run Coder with Coder Tough Love enabled and all applicable tests selected. Net result: your code is now guaranteed to be formatted in a way that's acceptable to the larger community, thereby removing an entire class of possible complaints by the reviewer.

Simpletest

Writing unit tests can be a PITA but from a module maintainer's perspective anything that makes testing your patch easier is going to be a win. If you're writing a patch for a module that doesn't have tests? Write some tests and add them to the patch (big ups to Wim Leers for writing the fakeadd script). Your praises will be sung from on high.

Freeman on web stuff

If it's wrong, bad or
stupid, let me just say that
I am not surprised.

- author unknown

User login

Navigation

More Drupal hotness

Powered by Drupal, an open source content management system