Commit graph

25 commits

Author SHA1 Message Date
Anas Nashif
3269b49b66 doc: coding guidelines: move safety related language to saftey section
Move some of the historical safety related language and
enforcement strategy re coding guidelines to the safety section.

The coding guidelines are and have been in effect for a while now,
but it seems this introduction text is confusing contributors.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2025-01-18 02:33:02 +01:00
Anas Nashif
4ee6b833c5 doc: convert coding guideline rules to definition lists
Use definition list instead of deep header levels.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2025-01-15 11:51:42 +01:00
Simon Hein
e37e3d5a85 doc: coding guidelines: Refactor the guidelines rule table
Refactor the guidelines rule table and add a zephyr rule number
to make it more clear that the coding guideline rules are a
subset of the MISRA-C:2012 rules.

Signed-off-by: Simon Hein <Shein@baumer.com>
2024-08-22 09:12:23 +02:00
Mathieu Choplain
a304f98ac1 doc: Coding guidelines: use fixed title for reference to Bluetooth APIs
Commit 698a0c3193 changed the bluetooth_api
section title, which made the reference in the Coding guidelines turn into
"API", which is confusing.

Use a fixed title for that reference to fix the issue.

Signed-off-by: Mathieu Choplain <mathieu.choplain@st.com>
2024-08-21 16:43:52 -04:00
Simon Hein
a5668c78d1 doc: guidelines: update coding guidelines docs
Remove references to a timline for the coding guidelines enforcement
stages. Mark the current stage better and add notes about the
current stage.

Signed-off-by: Simon Hein <Shein@baumer.com>
2024-07-09 15:23:18 -04:00
Jose Alberto Meza
33f905009d doc: eSPI: Update link to eSPI spec
Add link to eSPI spec 1.5
Update coding guidelines for eSPI bus

Signed-off-by: Jose Alberto Meza <jose.a.meza.arellano@intel.com>
2024-05-02 13:56:46 -04:00
Robert Lubos
f250080af6 doc: Add gmtime_r() to rule A.5 exceptions
According to commit 400c1fa744 which
introduced rule A.5 to the coding guidelines, the initial exception list
was based on the non-standard function availability in minimal libc.

gmtime_r() however, has not been included to the list, although it's
present in minimal libc since 3e8df8b369.

This commit fixes this, by adding gmtime_r() to the rule A.5 exception
list.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2024-02-28 00:54:42 +09:00
Alberto Escolar Piedras
ba81d439e4 doc coding_guidelines: Exclude host tooling from rule A.5
Rule A.5 is meant for code build with the embedded libCs and
which runs in embedded targets. Let's be more clear about this
and explicitly indicate that host tooling is not covered by it.
Otherwise, the current
"The "Zephyr codebase" in this context refers to all source
code files committed to the main Zephyr repository"
covers too much.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2024-01-30 18:00:48 +01:00
Johan Hedberg
c1dfa97960 doc: coding_guidelines: Update reference to Bluetooth language document
Update the reference to the Bluetooth Appropriate Language Mapping
Tables document. The link is now the same as the Bluetooth SIG website
uses.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2024-01-24 18:02:38 +01:00
Benjamin Cabé
de21b50002 doc: guidelines: drop mentions of Parasoft Codescan
Drop the section of the coding guidelines that's referring to Parasoft
Codescan as it's not used by the project anymore.

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2024-01-23 10:02:39 +01:00
Stephanos Ioannidis
400c1fa744 doc: Add Zephyr codebase C standard library usage restriction rule
This commit adds the "Rule A.5: C Standard Library Usage Restrictions
in Zephyr Codebase" to the coding guidelines.

The initial list of allowed non-ISO C libc functions is based on the
non-ISO C functions available in the minimal libc.

Signed-off-by: Stephanos Ioannidis <stephanos.ioannidis@nordicsemi.no>
2023-05-22 23:32:31 +09:00
Stephanos Ioannidis
fb93982348 doc: Add kernel C standard library usage restriction rule
This commit adds the "Rule A.4: C Standard Library Usage Restrictions
in Zephyr kernel" to the coding guidelines.

Signed-off-by: Stephanos Ioannidis <stephanos.ioannidis@nordicsemi.no>
2023-05-22 23:32:31 +09:00
Simon Hein
1ba19f3fb6 doc: Reword coding guidline Stage 2 description
Reword the Stage 2 description part about starting sometime after
LTS2.

Signed-off-by: Simon Hein <Shein@baumer.com>
2023-05-18 15:15:03 -04:00
Carles Cufi
d095f7d22f doc: coding guidelines: Add a new rule for macro name collisions
This commit is the outcome of the discussion that has taken place in
multiple forums:

Discord:
https://discord.com/channels/720317445772017664/1014241011989487716/1032623375228608522

GitHub:
https://github.com/zephyrproject-rtos/zephyr/issues/51371
https://github.com/zephyrproject-rtos/zephyr/pull/50239

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2023-02-22 09:39:57 -08:00
Roman Kellner
5a7b0fb616 doc: coding guidelines: Add rule based page hooks
Add rule based page hooks to allow to jump to
the respective rule in a webbrowser directly.

Example:

.../coding_guidelines/index.html#misrac-rule-2-2

Signed-off-by: Roman Kellner <rkellner@baumer.com>
2022-05-31 13:50:58 -07:00
Aleksandar Markovic
019c90e28f doc: Improve layout of MISRA-C rules table
The layout of this table unreasonably assigns narrow widths for
for column(s) with lots of content, and wise-versa.

Define relative column widths to be more in sync with column
content. This will potentially produce more compact table, making
it more readable, clearer and more visually pleasing.

Signed-off-by: Aleksandar Markovic <aleksandar.markovic.sa@gmail.com>
2022-04-25 14:06:31 -04:00
Henrik Brix Andersen
8bdfebf2ff doc: contribute: coding guidelines: add links to CAN inclusive language
Add links for the CAN in Automation recommendations for using inclusive
language terms in CAN.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2022-03-25 10:41:59 +01:00
Nazar Kazakov
f483b1bc4c everywhere: fix typos
Fix a lot of typos

Signed-off-by: Nazar Kazakov <nazar.kazakov.work@gmail.com>
2022-03-18 13:24:08 -04:00
Henrik Brix Andersen
2c0e0a74af doc: use extlink for github issue links
Use extlink for GitHub issue links in documentation.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2022-01-17 12:48:43 -05:00
Maksim Masalski
843ea97eac doc: add parasoft tool section to the coding guidelines page
Recently we started to use Parasoft Codescan Static Analysis tool
to fix MISRA violations and align code to follow our Coding Guidelines.
I started fixing violations, and adding suppression tages to fix
false-positive findings. Developers started to ask me, what I'm doing
here and where is the documentation page about that.

Add a new section describing violations fixing process using Parasoft
tool.

Signed-off-by: Maksim Masalski <maksim.masalski@intel.com>
2021-12-07 19:45:33 -05:00
Lauren Murphy
7ab16c457b doc: update coding guidelines compliance stages
Updates wording in Coding Guidelines page to remove outdated timelines
and correct the criteria for each stage. Changes reflect that we are
in stage 1 and will not reach stage 2 until the CI for enforcing
coding guidelines has been established.

Signed-off-by: Lauren Murphy <lauren.murphy@intel.com>
2021-09-24 17:14:48 -04:00
Flavio Ceolin
14899616a3 doc: coding_guideline: Add a MISRA-C mandatory rule to Zephyr
This guideline seems to be missed during the Zephyr's code guideline
creation. That is a good guideline that aims to address some problems
like double free or freeing not allocated memory.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2021-08-05 11:46:59 +02:00
Flavio Ceolin
70cd67579d doc: coding_guidelines: Add a MISRA-C mandatory rule to Zephyr
This guideline address three undefined behaviors listed in the C99
standard. Although Zephyr does not support/implement these functions,
they are part of the C library and could be implemented in the future.

Also this is mandatory rule in MISRA-C and if one day Zephyr decides to
claim compliance with MISRA-C this guideline has to be followed.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2021-08-05 11:46:59 +02:00
Flavio Ceolin
f5b42d0aa3 doc: code_guidelines: Sort guidelines
Guidelines between rules 21.x and 22.x where not properly sorted.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2021-07-21 17:32:31 -04:00
Anas Nashif
dd41aca3d3 doc: move coding guidelines under contribute/
Move coding guideline under contribution guidelines.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2021-06-11 08:50:39 -04:00