Skip to content

Establish C++ coding guidelines #45195

@stephanosio

Description

@stephanosio

Introduction

Establish C++ coding guidelines to be used in the Zephyr repository, and implement means to enforce them.

Problem description

While we have multiple coding and style guideline checkers such as checkpatch.pl and guideline_check.py for the C language, we do not for the C++ language. It is necessary to establish and enforce repository-wide C++ coding and style guidelines in order to ensure code quality and consistency.

Proposed change

  1. Adopt one or more C++ coding and style guidelines for use in the Zephyr repository.
    • Refer to the "Guideline Candidates" below.
  2. Adopt tools to enforce such guidelines in the CI.
  3. Document the guidelines.

Guideline Candidates

(please feel free to edit this RFC and add any other guidelines that you think would be good for consideration)

Enforcement Tool Candidates

  • clang-tidy, enforces C++ Core Guidelines (and more)
  • Cpplint, enforces Google C++ Style Guide

Metadata

Metadata

Assignees

Labels

RFCRequest For Comments: want input from the communityarea: C++area: Coding GuidelinesCoding guidelines and style

Type

Projects

Status

No status

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions