Skip to content

Latest commit

 

History

History
88 lines (71 loc) · 4.56 KB

CODING_STANDARDS.md

File metadata and controls

88 lines (71 loc) · 4.56 KB

Coding Standards

This document describes a few coding standards that are used in IKOS.

C++ Standard Version

IKOS is currently written in C++14.

Source Code Formatting

if (cond) {
  f();
} else if (cond1) {
  g();
} else {
  h();
}

Automatic Formatting

IKOS developers should use clang-format to format the source code with a predefined set of style rules.

See .clang-format for the set of rules.

Always run the following command before committing any changes:

$ git-clang-format -f

To run clang-format on the whole repository, use:

$ script/run-clang-format

Static Analysis

IKOS developers should use clang-tidy to perform diagnosis for typical programming errors, style violation, interface misuse, etc.

See .clang-tidy for the set of checks.

To run clang-tidy on the whole repository, use:

$ mkdir build
$ cd build
$ cmake ..
$ ../script/run-clang-tidy

Dynamic Analysis

IKOS developers should use clang sanitizers to check for undefined behaviors at run-time.

To build IKOS with clang sanitizers, use the following cmake options: