kc3-lang/angle/doc/CodingStandard.md

Download

Coding Standard for the ANGLE Project

Google Style Guide

We generally use the Google C++ Style Guide as a basis for our Coding Standard, however we will deviate from it in a few areas, as noted below.

Items marked {DEV} indicate a deviation from the Google guidelines. Items marked {DO} are reiterating points from the Google guidelines.

Before you upload code to Gerrit, use git cl format to auto-format your code. This will catch most of the trivial formatting errors and save you time.

Header Files

Scoping

Classes

Other C++ Features

Naming

File Names

Directory Names

Variable Names

Use the following guidelines, they do deviate somewhat from the Google guidelines.

Comments

//
//  Copyright $YEAR The ANGLE Project Authors. All rights reserved.
//  Use of this source code is governed by a BSD-style license that can be
//  found in the LICENSE file.
//

Formatting

Examples:

if (conditional)
{
    stuff();
}
else
{
    otherstuff()
}
switch (conditional)
{
  case foo:
    dostuff();
    break;
  case bar:
    otherstuff();
    break;
  default:
    WTFBBQ();
}
class MyClass : public Foo
{
  public:
    MyClass();
    ~MyClass() {};
  private:
    DISALLOW_COPY_AND_ASSIGN(MyClass);
};
char *c;
const string &str;

Exceptions to the Rules


Source

Download