This page is a work in progress and currently NOT official!
As a general rule, Evergreen contributions should follow these basic conventions.
if ($this) {
that();
} else {
something();
}
not
if ($this)
{
that();
}
else
{
something()
}
The following Vim options or something similar (often set via .vimrc) will help with proper indentation:
set tabstop=4 set softtabstop=4 set shiftwidth=4 set expandtab set backspace=indent,eol,start autocmd BufEnter ?akefile*,*txt,*out,*csv,*.c,*.h,*.sql set noet "use real tabs in Makefiles, text files, C code, and SQL files
In addition, the following VIM options have been recommended by a prominent Evergreen developer but are not actually format related
:
set hlsearch vnoremap < <gv vnoremap > >gv set nobk set whichwrap=b,s,<,>,[,] set smartcase filetype on syntax enable au BufNewFile,BufRead *.xhtml setf html au BufNewFile,BufRead *.bsh setf java au BufNewFile,BufRead *.ftl setf html set bg=dark let loaded_matchparen = 1
The following options are recommended when using perltidy to format your Perl code:
Example:
perltidy -ce -b Object.pm
This will tidy Object.pm and move your original to Object.pm.bak. Note that this will clobber an existing Object.pm.bak file!