Skip to content
jblomer edited this page Mar 21, 2012 · 3 revisions

Guidelines

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 use using 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-line if or a multi-line function definition)

Tools

  • 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
Clone this wiki locally