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?
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.
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.
- Match the coding style of the target Framework.
- Make sure that you code is well documented.
- Include unit-tests if the current framework uses them.
- Submit it in the form of a patch if appropriate.
- Check the website or wiki for coding conventions to use.
- Talk to the maintainers about what they would like to see.
- 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.
- If the Framework is Open Source - if all else fails then set up your own fork of the project with your code added.