blob: f6ffe9ae20012dda29674325be2e7f40bab9ece6 [file] [log] [blame]
<!DOCTYPE html>
<html class="writer-html5" lang="en" >
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Coding Guidelines &mdash; openPASS Documentation</title>
<link rel="stylesheet" href="../_static/css/theme.css" type="text/css" />
<link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
<link rel="stylesheet" href="../_static/tabs.css" type="text/css" />
<link rel="stylesheet" href="../_static/css/custom.css" type="text/css" />
<link rel="shortcut icon" href="../_static/openPASS.ico"/>
<!--[if lt IE 9]>
<script src="../_static/js/html5shiv.min.js"></script>
<![endif]-->
<script type="text/javascript" id="documentation_options" data-url_root="../" src="../_static/documentation_options.js"></script>
<script src="../_static/jquery.js"></script>
<script src="../_static/underscore.js"></script>
<script src="../_static/doctools.js"></script>
<script src="../_static/tabs.js"></script>
<script type="text/javascript" src="../_static/js/theme.js"></script>
<link rel="index" title="Index" href="../genindex.html" />
<link rel="search" title="Search" href="../search.html" />
<link rel="next" title="External Dependencies" href="../other_information/10_external_dependencies.html" />
<link rel="prev" title="Documentation Concept" href="20_documentation.html" />
</head>
<body class="wy-body-for-nav">
<div class="wy-grid-for-nav">
<nav data-toggle="wy-nav-shift" class="wy-nav-side">
<div class="wy-side-scroll">
<div class="wy-side-nav-search" >
<a href="../index.html" class="icon icon-home"> openPASS
<img src="../_static/openPASS.png" class="logo" alt="Logo"/>
</a>
<div class="version">
"develop_4d7f6d4f2e22c286789082dd8cbe3eb7f5b5af62"
</div>
<div role="search">
<form id="rtd-search-form" class="wy-form" action="../search.html" method="get">
<input type="text" name="q" placeholder="Search docs" />
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
</div>
</div>
<div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation">
<p class="caption"><span class="caption-text">Installation Guide</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../installation_guide/10_getting_started.html">Getting Started</a></li>
<li class="toctree-l1"><a class="reference internal" href="../installation_guide/15_system_requirements.html">System Requirements</a></li>
<li class="toctree-l1"><a class="reference internal" href="../installation_guide/20_install_prerequisites.html">Installing Prerequisites</a></li>
<li class="toctree-l1"><a class="reference internal" href="../installation_guide/30_install_openpass.html">Installing openPASS</a></li>
<li class="toctree-l1"><a class="reference internal" href="../installation_guide/50_further_guidance.html">Further Guidance</a></li>
<li class="toctree-l1"><a class="reference internal" href="../installation_guide/60_conan.html">Building with Conan</a></li>
</ul>
<p class="caption"><span class="caption-text">User Guides</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../user_guide/10_overview.html">Overview</a></li>
<li class="toctree-l1"><a class="reference internal" href="../user_guide/20_tutorials.html">Tutorials</a></li>
<li class="toctree-l1"><a class="reference internal" href="../user_guide/30_configs_in_depth.html">Configs in Depth</a></li>
<li class="toctree-l1"><a class="reference internal" href="../user_guide/40_outputs_in_depth.html">Outputs in Depth</a></li>
<li class="toctree-l1"><a class="reference internal" href="../user_guide/50_scenario_simulation.html">Simulator</a></li>
</ul>
<p class="caption"><span class="caption-text">Advanced topics</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../advanced_topics/20_simulator_advanced.html">Simulator</a></li>
<li class="toctree-l1"><a class="reference internal" href="../advanced_topics/30_testing.html">EndToEnd Test Framework</a></li>
</ul>
<p class="caption"><span class="caption-text">Developer Information</span></p>
<ul class="current">
<li class="toctree-l1"><a class="reference internal" href="10_ide_support.html">IDE Support</a></li>
<li class="toctree-l1"><a class="reference internal" href="20_documentation.html">Documentation Concept</a></li>
<li class="toctree-l1 current"><a class="current reference internal" href="#">Coding Guidelines</a><ul>
<li class="toctree-l2"><a class="reference internal" href="#general">General</a></li>
<li class="toctree-l2"><a class="reference internal" href="#naming-conventions">Naming Conventions</a></li>
<li class="toctree-l2"><a class="reference internal" href="#clangformat">ClangFormat</a></li>
<li class="toctree-l2"><a class="reference internal" href="#commit-message-guidelines">Commit Message Guidelines</a></li>
</ul>
</li>
</ul>
<p class="caption"><span class="caption-text">Other Information</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../other_information/10_external_dependencies.html">External Dependencies</a></li>
<li class="toctree-l1"><a class="reference internal" href="../other_information/20_glossary.html">Glossary</a></li>
<li class="toctree-l1"><a class="reference internal" href="../other_information/30_gui_plugins.html">GUI Plugins</a></li>
<li class="toctree-l1"><a class="reference internal" href="../other_information/40_license.html">License</a></li>
</ul>
</div>
</div>
</nav>
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">
<nav class="wy-nav-top" aria-label="top navigation">
<i data-toggle="wy-nav-top" class="fa fa-bars"></i>
<a href="../index.html">openPASS</a>
</nav>
<div class="wy-nav-content">
<div class="rst-content">
<div role="navigation" aria-label="breadcrumbs navigation">
<ul class="wy-breadcrumbs">
<li><a href="../index.html" class="icon icon-home"></a> &raquo;</li>
<li>Coding Guidelines</li>
<li class="wy-breadcrumbs-aside">
<a href="../_sources/developer_information/30_coding_conventions.rst.txt" rel="nofollow"> View page source</a>
</li>
</ul>
<hr/>
</div>
<div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
<div itemprop="articleBody">
<div class="section" id="coding-guidelines">
<span id="coding-conventions"></span><h1>Coding Guidelines<a class="headerlink" href="#coding-guidelines" title="Permalink to this headline"></a></h1>
<div class="section" id="general">
<h2>General<a class="headerlink" href="#general" title="Permalink to this headline"></a></h2>
<p><strong>openPASS</strong> (Open Source) is based on modern C++ (currently C++17). For coding guidelines, please refer to <a class="reference external" href="https://github.com/isocpp/CppCoreGuidelines">ISO C++ Core Guidelines</a>.</p>
<p><strong>Headers/Sources</strong></p>
<blockquote>
<div><ul class="simple">
<li><p>Use <code class="docutils literal notranslate"><span class="pre">*.h</span></code> as file extension for header files</p></li>
<li><p>Use <code class="docutils literal notranslate"><span class="pre">*.cpp</span></code> as file extension for source files</p></li>
</ul>
</div></blockquote>
</div>
<div class="section" id="naming-conventions">
<h2>Naming Conventions<a class="headerlink" href="#naming-conventions" title="Permalink to this headline"></a></h2>
<p>Concise summarized Naming Conventions
.. literalinclude:: _static/custom_doc/NamingConventions.txt</p>
<p><strong>Namespaces</strong></p>
<blockquote>
<div><ol class="arabic simple">
<li><p>Use lowercase for namespaces</p></li>
<li><p>Use singular form for namespaces where appropriate</p></li>
<li><p>Use base namespace <code class="docutils literal notranslate"><span class="pre">openpass</span></code></p></li>
<li><p>Core uses <code class="docutils literal notranslate"><span class="pre">openpass::core::*</span></code></p></li>
<li><p>Components use <code class="docutils literal notranslate"><span class="pre">openpass::component::*</span></code></p></li>
<li><p>Use the appropriate namespace for the type your component
* <code class="docutils literal notranslate"><span class="pre">openpass::component::algorithm</span></code>
* <code class="docutils literal notranslate"><span class="pre">openpass::component::sensor</span></code>
* <code class="docutils literal notranslate"><span class="pre">openpass::component::dynamics</span></code>
* <code class="docutils literal notranslate"><span class="pre">openpass::component::driver</span></code>
* …</p></li>
<li><p>Code with shared scope (e.g. <code class="docutils literal notranslate"><span class="pre">common</span></code>) namespaces are separated in
* For everyone <code class="docutils literal notranslate"><span class="pre">openpass::common</span></code> e.g. <code class="docutils literal notranslate"><span class="pre">openpass::common::XmlParser</span></code>
* Common for components <code class="docutils literal notranslate"><span class="pre">openpass::component::common</span></code> e.g. <code class="docutils literal notranslate"><span class="pre">openpass::components::Ports</span></code>
* For the core only <code class="docutils literal notranslate"><span class="pre">openpass::core::common</span></code> e.g. <code class="docutils literal notranslate"><span class="pre">openpass::core::common::Parameters</span></code></p></li>
<li><p>Discussion: <code class="docutils literal notranslate"><span class="pre">openpass::type::*</span></code>
Example: <code class="docutils literal notranslate"><span class="pre">openpass::type::Vector2D,</span> <span class="pre">openpass::type::OpenDriveId</span></code></p></li>
</ol>
</div></blockquote>
<p><strong>Interfaces</strong></p>
<blockquote>
<div><ol class="arabic">
<li><p>Interfaces should be named descriptively according to the functionality they outline with an <code class="docutils literal notranslate"><span class="pre">UpperCamelCase</span></code> name</p>
<p>Example: Interface for the <strong>world</strong> = <code class="docutils literal notranslate"><span class="pre">class</span> <span class="pre">WorldInterface</span></code></p>
</li>
<li><dl class="simple">
<dt>Interfaces are abstract classes, and as such provide pure virtual functions only, withtout any default implementation. For example:</dt><dd><p><code class="docutils literal notranslate"><span class="pre">virtual</span> <span class="pre">double</span> <span class="pre">GetDistance()</span> <span class="pre">const</span> <span class="pre">=</span> <span class="pre">0;</span></code></p>
</dd>
</dl>
</li>
<li><p>Interface methods <strong>do not</strong> exibit default parameters.</p></li>
<li><p>We excessively use <strong>gmock</strong>, so for every interface a fake interface should be provided</p>
<p>Example: <code class="docutils literal notranslate"><span class="pre">class</span> <span class="pre">FakeWorld</span> <span class="pre">:</span> <span class="pre">public</span> <span class="pre">WorldInterface</span> <span class="pre">{...};</span></code></p>
<p>Note: Following <strong>*Roy Osherove*</strong>, we use Fake instead of Mock, whick allows to distinguish Mocks and
Stubs more easily in the code</p>
</li>
</ol>
</div></blockquote>
<p><strong>Classes</strong></p>
<blockquote>
<div><ol class="arabic">
<li><p>Classes should be named descriptively according to the functionality they implement with an <code class="docutils literal notranslate"><span class="pre">UpperCamelCase</span></code> name</p></li>
<li><p>A Class implementing an Interface should have the Interfaces name (see below), with the Interface portion removed. For example:
.. code-block:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="k">class</span> <span class="nc">AgentBlueprint</span> <span class="p">:</span> <span class="n">public</span> <span class="n">AgentBlueprintInterface</span> <span class="p">{</span><span class="o">...</span><span class="p">};</span>
</pre></div>
</div>
</li>
</ol>
</div></blockquote>
<p><strong>Methods</strong></p>
<blockquote>
<div><ol class="arabic">
<li><p>Methods should be descriptively named in <code class="docutils literal notranslate"><span class="pre">UpperCamelCase</span></code></p>
<p>Example: Method for retrieving the time of day should be named <code class="docutils literal notranslate"><span class="pre">GetTimeOfDay()</span></code></p>
</li>
</ol>
</div></blockquote>
<p><strong>Member Variables</strong></p>
<blockquote>
<div><ol class="arabic">
<li><p>Member variables should be descriptively named in <code class="docutils literal notranslate"><span class="pre">lowerCamelCase</span></code></p></li>
<li><p>Normally, it is sufficient to use the classes name directly.</p>
<p>Example: The member variable containing the AgentNetwork should be named <code class="docutils literal notranslate"><span class="pre">agentNetwork</span></code></p>
</li>
</ol>
</div></blockquote>
<p><strong>Input / Output Signal Naming</strong></p>
<blockquote>
<div><ol class="arabic">
<li><p>Components use a special form of signal transmission. For easier use, the following abstraction is recommended:
.. code-block:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">std</span><span class="p">::</span><span class="nb">map</span><span class="o">&lt;</span><span class="nb">int</span><span class="p">,</span> <span class="n">ComponentPort</span> <span class="o">*&gt;</span> <span class="n">outputPorts</span><span class="p">;</span>
<span class="nb">bool</span> <span class="n">success</span> <span class="o">=</span> <span class="n">outputPorts</span><span class="o">.</span><span class="n">at</span><span class="p">(</span><span class="n">localLinkId</span><span class="p">)</span><span class="o">-&gt;</span><span class="n">SetSignalValue</span><span class="p">(</span><span class="n">data</span><span class="p">);</span>
</pre></div>
</div>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">std</span><span class="p">::</span><span class="nb">map</span><span class="o">&lt;</span><span class="nb">int</span><span class="p">,</span> <span class="n">ComponentPort</span> <span class="o">*&gt;</span> <span class="n">inputPorts</span><span class="p">;</span>
<span class="nb">bool</span> <span class="n">success</span> <span class="o">=</span> <span class="n">inputPorts</span><span class="o">.</span><span class="n">at</span><span class="p">(</span><span class="n">localLinkId</span><span class="p">)</span><span class="o">-&gt;</span><span class="n">GetSignalValue</span><span class="p">(</span><span class="n">data</span><span class="p">);</span>
</pre></div>
</div>
</li>
<li><p>Discussion: Wrap in <code class="docutils literal notranslate"><span class="pre">openpass::components::common::Port</span></code> and further
<code class="docutils literal notranslate"><span class="pre">openpass::components::common::Ports</span></code></p></li>
</ol>
</div></blockquote>
<p><strong>Additional Information</strong></p>
<blockquote>
<div><ol class="arabic simple">
<li><p>Use <code class="docutils literal notranslate"><span class="pre">UpperCamelCase</span></code> for abbreviations used in files, classes, methods, or variables</p></li>
<li><p>This does not apply if the abbreviation is the entire name or the beginning of the name - in such a case the name is written with the rules for the appropriate type</p>
<ul class="simple">
<li><p>int ID→int id</p></li>
<li><p>class AgentID→ class AgentId</p></li>
<li><p>ADASDriver.cpp→adasDriver.cpp</p></li>
</ul>
</li>
<li><p>Avoid public class data members. If unavoidable, use <code class="docutils literal notranslate"><span class="pre">lowerCamelCase</span></code></p></li>
<li><p>Enums should be preferably defined as enum class; as such, enum names should be in <code class="docutils literal notranslate"><span class="pre">UpperCamelCase</span></code></p></li>
<li><p>Decorate container by type aliases and use UpperCamelCase. For example:</p></li>
</ol>
<blockquote>
<div><div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">using</span> <span class="n">FooParts</span> <span class="o">=</span> <span class="n">std</span><span class="p">::</span><span class="n">vector</span><span class="o">&lt;</span><span class="n">FooPart</span><span class="o">&gt;</span><span class="p">;</span>
</pre></div>
</div>
</div></blockquote>
</div></blockquote>
<p><strong>Avoid</strong></p>
<blockquote>
<div><ol class="arabic simple">
<li><p>Do <strong>not</strong> use Hungarian notation for variables names (iCounter → counter)</p></li>
<li><p>Do <strong>not</strong> specify the type of the underlying implementation (partMap→ parts)</p></li>
<li><p>Do <strong>not</strong> use magic numbers in the code; explicitly define constants instead</p></li>
<li><p>Do <strong>not</strong> use global variables</p></li>
</ol>
</div></blockquote>
<p><strong>Exceptions</strong></p>
<blockquote>
<div><ol class="arabic">
<li><p>Autogenerated code does not need to follow the coding conventions</p>
<p>Example:: Signals/Slots (QT): <code class="docutils literal notranslate"><span class="pre">void</span> <span class="pre">on_button_clicked();</span></code></p>
</li>
</ol>
</div></blockquote>
<p><strong>Documentation</strong></p>
<blockquote>
<div><ol class="arabic">
<li><p>The following should be documented
* Public functions and class methods
* Classes
* File headers
* Constants
* Private functions or methods with more than 3 arguments and/or complex functionality??</p></li>
<li><p>Language
* Document “what” it does rather than describing “why”
* Third-person singular verbs should be used to describe what it does</p></li>
<li><p>Use the below methods to comment in source code. The below 2 syntaxes must be placed just above an entity.</p>
<p>Multi line comments</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span>//! … comments…
//! … comments…
//! … comments…
</pre></div>
</div>
<p>Single line comments</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="o">///</span> <span class="n">Comments</span><span class="o">.</span>
</pre></div>
</div>
</li>
<li><p>Use the following structural commands</p>
<table class="colwidths-given docutils align-default">
<colgroup>
<col style="width: 33%" />
<col style="width: 67%" />
</colgroup>
<thead>
<tr class="row-odd"><th class="head"><p>Syntax</p></th>
<th class="head"><p>Definition</p></th>
</tr>
</thead>
<tbody>
<tr class="row-even"><td><p>&#64;file</p></td>
<td><p>The file name must be present in the file header</p></td>
</tr>
<tr class="row-odd"><td><p>&#64;param[in/out]</p></td>
<td><p>Parameter documentation for functions</p></td>
</tr>
<tr class="row-even"><td><p>&#64;page</p></td>
<td><p>Markdown page name</p></td>
</tr>
</tbody>
</table>
</li>
<li><p>Use the following syntax for parameter description</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="nd">@param</span><span class="p">[</span><span class="ow">in</span><span class="o">/</span><span class="n">out</span><span class="p">]</span> <span class="o">&lt;</span><span class="n">variable</span> <span class="n">name</span><span class="o">&gt;</span> <span class="o">&lt;</span><span class="n">variable</span> <span class="n">description</span><span class="o">&gt;</span>
</pre></div>
</div>
</li>
<li><p>All parameters description should be aligned as shown below to make them more readable.</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="nd">@param</span><span class="p">[</span><span class="ow">in</span><span class="p">]</span> <span class="n">shortName</span> <span class="n">Description</span><span class="o">.</span>
<span class="nd">@param</span><span class="p">[</span><span class="ow">in</span><span class="p">]</span> <span class="n">longerName</span> <span class="n">Description</span><span class="o">.</span>
<span class="nd">@param</span><span class="p">[</span><span class="n">out</span><span class="p">]</span> <span class="n">veryLongName</span> <span class="n">Description</span><span class="o">.</span>
</pre></div>
</div>
</li>
<li><p>Example</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span>/// @file main.c
#include&lt;stdio.h&gt;
/// Mathematical constant PI
#define PI 3.1415
/// Radius in meters
#define RADIUS_M 7.82
//! Calculates the area of the circle.
//!
//! @param[in] radius Radius of the circle
//! @param[out] area Area of the circle
float CalculateArea(float radius)
{
float area;
area = PI * radius * radius;
return area;
}
</pre></div>
</div>
</li>
<li><p>Do not comment on polymorph methods (virtual base → override), unless there is a severe change</p></li>
</ol>
</div></blockquote>
<p><strong>End Of Line</strong></p>
<blockquote>
<div><ol class="arabic simple">
<li><p>Native end of line (EOL) should be used in the working directory</p></li>
<li><p>The <code class="docutils literal notranslate"><span class="pre">.gitattributes</span></code> configuration file provides correct EOL handling for <code class="docutils literal notranslate"><span class="pre">git</span></code> related commands and actions</p></li>
<li><p>When editing files</p>
<ul class="simple">
<li><p>Trim trailing whitespaces</p></li>
<li><p>Single EOL at end of files</p></li>
<li><p>Use spaces for tabs (use tab size according to coding guidelines or existing file contents)</p></li>
</ul>
</li>
</ol>
</div></blockquote>
<p>See <a class="reference internal" href="ide_support/30_vscode.html#vscode-user-settings"><span class="std std-ref">Example VSCode user settings</span></a>.</p>
</div>
<div class="section" id="clangformat">
<h2>ClangFormat<a class="headerlink" href="#clangformat" title="Permalink to this headline"></a></h2>
<p>To ensure consistent and readable code across the project, <strong>ClangFormat</strong> is recommended.</p>
<div class="admonition note">
<p class="admonition-title">Note</p>
<p>The following guidelines are based on ClangFormat version 15.0.7</p>
</div>
<p><strong>Installing ClangFormat</strong></p>
<p>To install <strong>ClangFormat 15.0.7</strong>, execute the following command depending on the operating system.</p>
<div class="sphinx-tabs docutils container">
<div aria-label="Tabbed content" class="closeable" role="tablist"><button aria-controls="panel-0-0-0" aria-selected="true" class="sphinx-tabs-tab" id="tab-0-0-0" name="0-0" role="tab" tabindex="0">Windows</button><button aria-controls="panel-0-0-1" aria-selected="false" class="sphinx-tabs-tab" id="tab-0-0-1" name="0-1" role="tab" tabindex="-1">Linux (Debian Bookworm or Ubuntu 22.04)</button></div><div aria-labelledby="tab-0-0-0" class="sphinx-tabs-panel" id="panel-0-0-0" name="0-0" role="tabpanel" tabindex="0"><div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">pacman</span> <span class="o">-</span><span class="n">S</span> <span class="n">mingw</span><span class="o">-</span><span class="n">w64</span><span class="o">-</span><span class="n">x86_64</span><span class="o">-</span><span class="n">clang</span>
</pre></div>
</div>
</div><div aria-labelledby="tab-0-0-1" class="sphinx-tabs-panel" hidden="true" id="panel-0-0-1" name="0-1" role="tabpanel" tabindex="0"><div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">apt</span> <span class="o">-</span><span class="n">y</span> <span class="n">install</span> <span class="n">clang</span><span class="o">-</span><span class="nb">format</span>
</pre></div>
</div>
</div></div>
<p><strong>Configuring ClangFormat</strong></p>
<p>To configure ClangFormat, create a <cite>.clang-format</cite> file in the root directory of your project. Below is the configuration used in <strong>openPASS</strong> (Open Source):</p>
<blockquote>
<div><div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="o">---</span>
<span class="n">BasedOnStyle</span><span class="p">:</span> <span class="n">Google</span>
<span class="n">AccessModifierOffset</span><span class="p">:</span> <span class="o">-</span><span class="mi">2</span>
<span class="n">AllowShortFunctionsOnASingleLine</span><span class="p">:</span> <span class="n">Inline</span>
<span class="n">AlignOperands</span><span class="p">:</span> <span class="n">AlignAfterOperator</span>
<span class="n">BinPackArguments</span><span class="p">:</span> <span class="n">false</span>
<span class="n">BinPackParameters</span><span class="p">:</span> <span class="n">false</span>
<span class="n">BreakBeforeBraces</span><span class="p">:</span> <span class="n">Allman</span>
<span class="n">BreakBeforeBinaryOperators</span><span class="p">:</span> <span class="n">All</span>
<span class="n">ColumnLimit</span><span class="p">:</span> <span class="mi">120</span>
<span class="n">SpacesInLineCommentPrefix</span><span class="p">:</span>
<span class="n">Minimum</span><span class="p">:</span> <span class="mi">0</span>
<span class="n">Maximum</span><span class="p">:</span> <span class="mi">1</span>
<span class="n">CommentPragmas</span><span class="p">:</span> <span class="s1">&#39;^</span><span class="se">\\</span><span class="s1">.+&#39;</span>
<span class="n">IncludeCategories</span><span class="p">:</span>
<span class="o">-</span> <span class="n">Regex</span><span class="p">:</span> <span class="s1">&#39;^((&lt;|&quot;)(gtest|gmock)/)&#39;</span>
<span class="n">Priority</span><span class="p">:</span> <span class="o">-</span><span class="mi">1</span>
<span class="o">-</span> <span class="n">Regex</span><span class="p">:</span> <span class="s1">&#39;^&lt;[^Q]&#39;</span>
<span class="n">Priority</span><span class="p">:</span> <span class="mi">1</span>
<span class="o">-</span> <span class="n">Regex</span><span class="p">:</span> <span class="s1">&#39;^&lt;Q&#39;</span>
<span class="n">Priority</span><span class="p">:</span> <span class="mi">2</span>
</pre></div>
</div>
</div></blockquote>
<p><strong>Running ClangFormat</strong></p>
<p>To format the code using ClangFormat, run the following command in the terminal:</p>
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>clang-format -i <span class="o">[</span>source_file<span class="o">(</span>s<span class="o">)]</span>
</pre></div>
</div>
<p>Replace <cite>[source_file(s)]</cite> with the path(s) to the file(s) to format. The <cite>-i</cite> option tells ClangFormat to modify the files in-place.</p>
</div>
<div class="section" id="commit-message-guidelines">
<h2>Commit Message Guidelines<a class="headerlink" href="#commit-message-guidelines" title="Permalink to this headline"></a></h2>
<p><strong>Overview</strong></p>
<p>This section outlines the guidelines for writing commit messages in openPASS repository. Following these guidelines ensures that commit messages are clear, descriptive, and help facilitate collaboration among team members.
This section uses excerpts from <a class="reference external" href="https://www.conventionalcommits.org/en/v1.0.0/">Conventional Commits</a> licensed under <a class="reference external" href="https://creativecommons.org/licenses/by/3.0/">CC BY 3.0</a> by it’s authors.</p>
<p><strong>Commit Message Format</strong></p>
<p>Each commit message should consist of a single short summary line (recommended, up to 50 characters) followed by a more detailed description (if necessary).
The message should adhere to the following format:</p>
<blockquote>
<div><blockquote>
<div><div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="o">&lt;</span><span class="nb">type</span><span class="o">&gt;</span><span class="p">[</span><span class="n">optional</span> <span class="n">scope</span><span class="p">]:</span> <span class="o">&lt;</span><span class="n">description</span><span class="o">&gt;</span>
<span class="p">[</span><span class="n">optional</span> <span class="n">body</span><span class="p">]</span>
<span class="p">[</span><span class="n">optional</span> <span class="n">footer</span><span class="p">(</span><span class="n">s</span><span class="p">)]</span>
</pre></div>
</div>
</div></blockquote>
<ol class="arabic simple">
<li><p>The <code class="docutils literal notranslate"><span class="pre">&lt;type&gt;</span></code> part represents the type of the commit, which helps in categorizing the nature of the changes. The following types are allowed:</p>
<ul class="simple">
<li><p><code class="docutils literal notranslate"><span class="pre">feat</span></code>: A new feature or enhancement.</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">fix</span></code>: A bug fix.</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">docs</span></code>: Documentation-related changes.</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">style</span></code>: Code style changes (e.g., formatting, spacing).</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">refactor</span></code>: Code refactoring without adding new features or fixing bugs.</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">test</span></code>: Adding or improving tests.</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">chore</span></code>: Maintenance tasks, build changes, or other non-functional modifications.</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">ci</span></code>: Changes related to CI.</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">build</span></code>: Modifications related to build step.</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">perf</span></code>: Modifications related to performance improvements.</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">revert</span></code>: Revert any code changes.</p></li>
</ul>
</li>
<li><p>The <code class="docutils literal notranslate"><span class="pre">&lt;optional</span> <span class="pre">scope&gt;</span></code> section is optional but is used to provide additional contextual information and is contained within parenthesis.</p></li>
<li><p>The <code class="docutils literal notranslate"><span class="pre">&lt;description&gt;</span></code> is a brief description of the changes made in the commit. It should be concise yet informative and is recommended to not exceed 50 characters.</p></li>
<li><p>The <code class="docutils literal notranslate"><span class="pre">&lt;optional</span> <span class="pre">body&gt;</span></code> section is optional but recommended, especially for complex changes or when further explanation is needed. This section should provide additional context, justification, and details about the changes made. Use bullet points for better readability when necessary.</p></li>
<li><p>The <code class="docutils literal notranslate"><span class="pre">&lt;optional</span> <span class="pre">footer&gt;</span></code> section is also optional but can be used to provide supplementary information related to the commit.</p></li>
</ol>
</div></blockquote>
</div>
</div>
</div>
</div>
<footer>
<div class="rst-footer-buttons" role="navigation" aria-label="footer navigation">
<a href="../other_information/10_external_dependencies.html" class="btn btn-neutral float-right" title="External Dependencies" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right" aria-hidden="true"></span></a>
<a href="20_documentation.html" class="btn btn-neutral float-left" title="Documentation Concept" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left" aria-hidden="true"></span> Previous</a>
</div>
<hr/>
<div role="contentinfo">
<p>
&#169; Copyright 2023 openPASS Working Group.
</p>
</div>
Built with <a href="https://www.sphinx-doc.org/">Sphinx</a> using a
<a href="https://github.com/readthedocs/sphinx_rtd_theme">theme</a>
provided by <a href="https://readthedocs.org">Read the Docs</a>.
</footer>
</div>
</div>
</section>
</div>
<script type="text/javascript">
jQuery(function () {
SphinxRtdTheme.Navigation.enable(true);
});
</script>
</body>
</html>