Skip to content
rbayer edited this page Feb 26, 2012 · 8 revisions

#K-9 Code Style

Indentation and formatting are enforced by software:

astyle --style=java --indent=spaces=4 --brackets=attach --convert-tabs   --unpad-paren --pad-header --pad-oper --suffix=none --recursive "src/com/fsck/k9/*.java"

We use Astyle 1.24

Indentation for things outside src/com/fsck is to be left alone.

Try to follow the AOSP Java style guide wherever possible, but as a volunteer project, please read their admonition:

The rules below are not guidelines or recommendations, but strict rules. Contributions to Android generally will not be accepted if they do not adhere to these rules.

as

We would very much like it if you would try not to deviate too wildly from this standard. If you do, it makes our lives a bit harder. But we'd rather work with you to get your code into shape than have you not contribute.

EOL

We're trying to make sure all source and resource files consistently use LFs as line delimiters to avoid merge conflicts.

On Windows, the easiest way to handle this is to have git do it for you. By executing $ git config --global core.autocrlf true at any command prompt. This will cause git to checkout files using Windows-style line endings (CRLF), but all checkins will convert line endings to LF.

On Mac and Linux, you can use $ git config --global core.autocrlf input to make sure you only commit LF line endings.

Clone this wiki locally