diff --git a/doc/style.md b/doc/style.md index 782c29728..698454748 100644 --- a/doc/style.md +++ b/doc/style.md @@ -157,30 +157,61 @@ Similarly, we write `x < y + 1` instead of `x``. If you need to cast within a class hierarchy, use ``static_cast<>`` to upcast. Google doesn't support RTTI. - - "public:" should be preceded by a blank line [whitespace/blank_line] - - Missing space before ``{`` [whitespace/braces] + - "public:" should be preceded by a blank line + - Missing space before ``{`` - Found C system header after C++ system header. Should be: - environment.h, c system, c++ system, other. [build/include_order] - [4] + environment.h, c system, c++ system, other. - Labels should always be indented at least one space. If this is a member-initializer list in a constructor or the base class list in a class definition, the colon should be on the following line. - [whitespace/labels] - - You don't need a ``;`` after a ``}`` [readability/braces] + - You don't need a ``;`` after a ``}`` - No ``#ifndef`` header guard found - Streams are highly discouraged. - - Extra space before ``(`` in function call [whitespace/parens] - - Else clause should never be on same line as else [whitespace/newline] - - Extra space before ``)`` [whitespace/parens] - - Is this a non-const reference? If so, make const or use a pointer. [runtime/references] + - Extra space before ``(`` in function call + - Else clause should never be on same line as else + - Extra space before ``)`` + - Is this a non-const reference? If so, make const or use a pointer. + - All parameters should be named in a function + +Modified Features: + + - Add ``#include `` for ``list<>`` + + => *Check* ``std::list`` instead of ``list`` because we do have our own ``lean::list`` type. + + - Add ``#include `` for copy + + => *Check* ``std::copy`` instead of ``copy`` because we do have our own ``lean::copy`` method. + + - Do not use namespace using-directives. Use using-declarations instead. + + => *Allow* this if filename contains "tests/" + + - Small and focused functions are preferred: foo() + has xxx non-comment lines (error triggered by exceeding 500 lines). + + => *Allow* this if filename contains "tests/" + + - Include the directory when naming .h files + + => *Allow* this if the included filename is "version.h" which is generated by cmake. [google-style]: http://google-styleguide.googlecode.com/svn/trunk/cppguide.xml +[cpplint]: /src/cmake/Modules/cpplint.py