views:

49

answers:

3

I've been working on a project for a while, producing a small pile of code to do a specific task as a part of a larger framework. Now the time has come to publicly include this code in the framework. What do you suggest to do with the code before pushing it to the publicly available repository? How can I prepare it in a way to have the least amount of debate with the maintainers? What is Right Way?

+1  A: 

Look through the parts of the framework your code will be included in. Mirror the coding style exactly in your code. Make sure you have anything else they use such as e.g. unit tests/Doxygen documentation/architecture documentation.

The framework may have a wiki page for this stuff. Above all, be very willing to spend a reasonably large amount of time getting it to exactly how they want. Only the current maintainers will be able to tell you exactly what they require so be patient and ask them early.

Mike McQuaid
A: 

Each open source project usually has their own conventions for code contributions. Have you looked at their web site if it has some instructions? Or then just email the developers (maybe through their mailing list) that how they want to include contributions.

Esko Luontola
+4  A: 
  1. Match the coding style of the target Framework.
  2. Make sure that you code is well documented.
  3. Include unit-tests if the current framework uses them.
  4. Submit it in the form of a patch if appropriate.
  5. Check the website or wiki for coding conventions to use.
  6. Talk to the maintainers about what they would like to see.
  7. Don't be suprised if it is rejected several times - it may not match the direction the maintaners want to take the code, and some maintainers may be closed minded about this.
  8. If the Framework is Open Source - if all else fails then set up your own fork of the project with your code added.
Frozenskys