Skip to content

Commit

Permalink
doc: update coding guidelines
Browse files Browse the repository at this point in the history
This patch updates coding guidelines about legal entity.

Signed-off-by: Shiqing Gao <shiqing.gao@intel.com>
  • Loading branch information
shiqingg authored and dbkinder committed May 23, 2019
1 parent 04ccaac commit 7e52067
Show file tree
Hide file tree
Showing 2 changed files with 70 additions and 0 deletions.
35 changes: 35 additions & 0 deletions doc/developer-guides/asm_coding_guidelines.rst
Expand Up @@ -704,6 +704,41 @@ Compliant example::
/* This is a comment. This is a comment. This is a comment. This is a comment. This is a comment. This is a comment. This is a comment. */


ASM-CS-08: Legal entity shall be documented in every file
=========================================================

Legal entity shall be documented in a separate comments block at the start of
every file.
The following information shall be included:

a) Copyright
b) License (using an `SPDX-License-Identifier <https://spdx.org/licenses/>`_)

Compliant example::

/* Legal entity shall be placed at the start of the file. */
-------------File Contents Start After This Line------------
/*
* Copyright (C) 2019 Intel Corporation.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
/* Coding or implementation related comments start after the legal entity. */
.code64

.. rst-class:: non-compliant-code

Non-compliant example::

/* Neither copyright nor license information is included in the file. */
-------------------File Contents Start After This Line------------------
/* Coding or implementation related comments start directly. */
.code64



Naming Convention
*****************
Expand Down
35 changes: 35 additions & 0 deletions doc/developer-guides/c_coding_guidelines.rst
Expand Up @@ -3286,6 +3286,41 @@ Compliant example::
int32_t func_showcase(uint32_t *param_1, uint32_t param_2, uint32_t param_3);


C-CS-19: Legal entity shall be documented in every file
=======================================================

Legal entity shall be documented in a separate comments block at the start of
every file.
The following information shall be included:

a) Copyright
b) License (using an `SPDX-License-Identifier <https://spdx.org/licenses/>`_)

Compliant example::

/* Legal entity shall be placed at the start of the file. */
-------------File Contents Start After This Line------------
/*
* Copyright (C) 2019 Intel Corporation.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
/* Coding or implementation related comments start after the legal entity. */
#include <types.h>

.. rst-class:: non-compliant-code

Non-compliant example::

/* Neither copyright nor license information is included in the file. */
-------------------File Contents Start After This Line------------------
/* Coding or implementation related comments start directly. */
#include <types.h>


Naming Convention
*****************

Expand Down

0 comments on commit 7e52067

Please sign in to comment.