We use LLVM Coding Conventions with some project-specific modifications.
Some of them:
- Use LF-ended source files (*.cpp, *.h, *.hpp, etc.);
- Use ASCII symbols only (no Cyrillic symbols are allowed);
- Basic indent is 2 spaces (no tabs are allowed);
- Maximum line length is 80 (no trailing whitespaces!);
- Do not use multiple blank lines in succession;
- Use lowercase_underscore_separated style for names of source files;
- Use UpperCamelCase style for names of classes/enums/structures/unions;
- Use lowerCamelCase for names of functions/methods/objects/variables;
- "{" symbol should be on the same line as the related operator;
- "using namespace" is forbidden;
- Source files should have header comments (set the
<yearnum>
here):
//===----------------------------------------------------------------------===//
//
// Part of the Utopia HLS Project, under the Apache License v2.0
// SPDX-License-Identifier: Apache-2.0
// Copyright <yearnum>-<yearnum> ISP RAS (http://www.ispras.ru)
//
//===----------------------------------------------------------------------===//
- All the header files should have Doxygen-formatted comments for classes:
/**
* \brief Implements a very useful thing.
* \author <a href="mailto:[email protected]">Ivan Ivanov</a>
*/
- All includes should be listed in the following order: 1) project's own includes; 2) side library includes; 3) system includes. Includes should be sorted in alphabetical order at every category.