forked from cvmfs/cvmfs
-
Notifications
You must be signed in to change notification settings - Fork 0
Code Style Guide
jblomer edited this page Mar 21, 2012
·
3 revisions
The starting point of the cvmfs code style guide is Google C++ style guide.
We have the following exceptions/adjustments:
- We do use
alloca()
- We use Doxygen comments. In order to not confuse the style guide checker, we use the
/**
form only (e.g. not///<
but/**< */
) - We do not include the full copyright in each and every file. The copyright is the way it is, no matter if we write a notice or not. It's sufficient to add a comment saying that the file is part of CernVM-FS
- Including files with project-relative paths makes no sense (at the moment) as virtually all source files are in ./cvmfs.
-
using namespace std;
in a .cc file is allowed. In order to keep the style checker quiet, we useusing namespace std; // NOLINT
- We do a line break before the opening curly bracket (
{
), if the bracket is at the end of a multi-line statement (e.g. a multi-lineif
or a multi-line function definition)
- There is a style guide checker, which can be invoked like that: python cpplint.py --filter=-legal/copyright,-build/include cvmfs/cvmfs.cc
- For Xcode, there is a plugin that gets the white spaces right when files are saved