Skip to content

Dev guide: Coding and Style Conventions

John Sichi edited this page Feb 9, 2021 · 2 revisions

Coding Conventions

The coding conventions for JGraphT are specified in etc/eclipse-formatter-settings.xml; follow the patterns you see in existing source files, but don't worry too much about the details, because we use Eclipse to automatically reformat all of the code as part of each release. 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.

Style

We use checkstyle to enforce a few basic rules such as the existence of proper documentation, no tab characters, etc. The checks are specified in etc/jgrapht_checks.xml and are executed automatically during continuous integration via Github Actions. To check locally that your contribution adheres to these rules, both commands

mvn checkstyle:check -P checkstyle

and

mvn javadoc:aggregate

should complete with no errors.

Clone this wiki locally