-
Notifications
You must be signed in to change notification settings - Fork 0
Contributor Guidelines
The command "mvn install" must run through with no errors and no warnings. We don't care whether the build seems to work from your IDE; mvn is the final criterion for a good checkin. This target will build all library code and tests, run through all tests, run javadoc, and build an archive. Unfortunately, there is no way to get the build to stop on warnings for javac and javadoc, so please scan the output carefully. (If you know of a way to fix this, please contribute a buildfile change.)
The build is set up to turn on all lint warnings for most packages; for legacy code such as some of the experimental classes and the JGraph adapter, the build is set up to disable warnings from javac. Likewise, this code has explicit @SuppressWarnings
annotations to disable the warnings per-method in IDE's. If you are using Eclipse, verify that your changes do not cause any unsupressed warnings for a full build. New code really shouldn't be adding any new warnings unless you are working on an existing class which was already failing lint, so try not to add any new SuppressWarnings annotations (instead, raise the problem on the jgrapht-developers list and get help; there may be a solution)
All code submitted needs to be accompanied by working JUnit tests which cover its functionality.
In general, JGraphT follows the coding conventions from LucidDB. Specific refinements include project file headers; please follow the pattern set by existing source files. Also, be sure to preserve existing authorship attribution, and give due credit to all contributors and external sources. And set your editor to use spaces only, never tabs.
NOTE: this section needs to be updated now that we're using Maven instead of ant.
- Create a project by importing the ant buildfile; pick the third javac in the list when prompted
- Open project properties window
- For Java build path, add the testsrc directory
- For Java compiler, set compiler compliance level to
6.0
- For Java Code Style, Formatter, import
jgrapht/etc/eclipse-formatter-settings.xml
- For Java Code Style, Organize Imports, set number of imports needed for
.*
to0
so that imports are always collapsed (please forget those dire warnings your grandmother told you about this being dangerous; it's a myth!)
If you use a different IDE, please use equivalent settings. If you are enlightened enough to use Emacs, contact jvs@lingeringsocket.com to get a .emacs file which matches these settings.
Please note that the Eclipse code format settings above don't exactly match our coding conventions. In particular, Eclipse doesn't wrap long lines correctly for initializer statements. So don't use these settings to reformat existing code; use them to format your new code, and then make changes as necessary to stay under the standard 80-character line length.