Commit graph

198 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
Carles Cufi
ea4e46d075 doc: contribute: Extend Reviewer Expectations with additional rules
This change was triggered by a review comment linked below:
https://github.com/zephyrproject-rtos/zephyr/pull/83117#issuecomment-2549120181

It extends the current Reviewer Expectations with additional rules
agreed upon by multiple Zephyr contributors in order to simplify and
standardize the decision-making process during PR reviews.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2025-01-17 19:43:32 +01:00
Carles Cufi
3756f59a55 doc: contribution guidelines: Clarify and extend
Clarify and extend some of the PR and contribution guidelines so that
they cover practices that have been effectively enforced by maintainers,
but were never properly documented.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2025-01-17 19:43:17 +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
Gerard Marull-Paretas
602290e838 doc: doc-guidelines: document :project: option for doxygengroup
The doxygengroup now supports specifying a project, document this
feature.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2025-01-08 11:30:54 +01:00
Carles Cufi
3c420a4828 checkpatch: Adapt the braces check to Zephyr
scripts/checkpatch.pl was written originally for the Linux kernel, and
its code reflects the kernel's coding style. In particular, it has
checks for unneeded braces around single-statement if/else/for/while
conditions. In Zephyr however, braces are always required, and so the
checks needed modifying to verify the opposite condition.

In order to enable the now-compatible checks, we also remove the
--ignore BRACES statement in .checkpatch.conf.

Limitations: the current code works well if there are not conditional
statements (e.g. #if, #ifdef or #endif) next to the if/else/for/while
conditions. This is rarely the case, but triggers with the Bluetooth
controller in code like this:

```
 #if defined(CONFIG_BT_PERIPHERAL)
        if (!lll->is_hdcd)
 #endif /* CONFIG_BT_PERIPHERAL */
        {
```

```
        } else
 #endif /* CONFIG_BT_CTLR_PRIVACY */
        {

```

```
 #if defined(CONFIG_BT_CTLR_DF_ADV_CTE_TX)
        if (lll->cte_started) {
                radio_switch_complete(phy_s, 0, phy_s, 0);
        } else
 #endif /* CONFIG_BT_CTLR_DF_ADV_CTE_TX */
        {
```

```
 #ifdef DUAL_BANK
        while ((FLASH_STM32_REGS(dev)->SR1 & FLASH_SR_QW) ||
               (FLASH_STM32_REGS(dev)->SR2 & FLASH_SR_QW))
 #else
        while (FLASH_STM32_REGS(dev)->SR1 & FLASH_SR_QW)
 #endif
        {
```

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2024-12-30 21:46:47 +01:00
Anas Nashif
306d2f4a56 doc: contributor: change language around PR review escalation
Refrain from using Escalation language when requesting review and
getting awareness from maintainers.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2024-12-13 17:44:52 +01:00
Jilay Pandya
5f418f506c docs: contribute: documentation: generation: fix missing doc
fix the path where the user has to be in order to execute make html-fast

Signed-off-by: Jilay Pandya <jilay.pandya@outlook.com>
2024-11-14 20:37:45 -06:00
Pisit Sawangvonganan
1175f57640 doc: fix typo in multiple directories before v4.0.0 release
Utilize a code spell-checking tool to scan for and correct spelling errors
in various files within the `doc` directory.

Signed-off-by: Pisit Sawangvonganan <pisit@ndrsolution.com>
2024-11-13 13:35:49 -06:00
Benjamin Cabé
074c0492ce doc: guidelines: add target-notes instructions and example
.. target-notes:: is a useful directive that needs to explicitly be
included for a "References" section to really be useful. This commit
updates the doc guidelines accordingly to help ensure that future docs
are using it correctly.

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2024-10-23 15:30:44 -05:00
Benjamin Cabé
b58b8964d3 boards: seeed: adopt new zephyr:board directive and role
This updates the documentation of all the Seeed Studio boards to use
the new `zephyr:board::` directive.

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2024-10-22 14:11:27 +02:00
Benjamin Cabé
ecb7c875dd doc: boards: extensions: introduce zephyr:board role and directive
A new zephyr:board:: Sphinx directive allows  to flag a documentation
page as being the documentation for a specific board, allowing to
auto-populate some of the contents, ex. by adding a board overview a la
Wikipedia, and later things like supported HW features, etc.

A corresponding :zephyr:board: role allows to link to a board doc page.

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2024-10-22 14:11:27 +02:00
Reto Schneider
7ba0ee6bca doc: blobs: Document startup notification
Due to the (potentially) hard to understand effects of blobs, it seems
prudent to make their presence more noticeable.

Hopefully, this will make it easier to identify issues (such as those
reported on GitHub) that have been observed on devices running a tainted
build.

Signed-off-by: Reto Schneider <reto.schneider@husqvarnagroup.com>
2024-10-21 15:58:27 +02:00
Reto Schneider
d5559ff82b doc: blobs: Add missing period
A full sentence should be ended by a period.

Signed-off-by: Reto Schneider <reto.schneider@husqvarnagroup.com>
2024-10-21 15:58:27 +02:00
Reto Schneider
bdea85c9cf doc: blobs: Remove superfluous spaces
While not visible in the rendered documentation, double spaces look bad
when reading plaintext file.

Signed-off-by: Reto Schneider <reto.schneider@husqvarnagroup.com>
2024-10-21 15:58:27 +02:00
Benjamin Cabé
f2f1496156 doc: Introduce boards catalog
This commit adds support for generating an interactive catalog of all
the supported boards that can be included in the documentation using
the `.. zephyr:board-catalog::` directive.

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2024-10-10 14:56:57 -04:00
Arrel Neumiller
703eadde5c Doc: Contribute: Add instructions for GitHub profile name and email
Fixes 78713
Add instructions to the "Git Setup" section to ensure that the user's
GitHub profile name is their full name (first and last) and that the
GitHub profile name and email address match the git config user.name
and user.email.

Page: contribute/guidelines
Tested with:
ninja html
python3 -m http.server 8000

Signed-off-by: Arrel Neumiller <rlneumiller@gmail.com>
2024-09-26 03:32:40 -04:00
Benjamin Cabé
793c70d095 doc: extensions: samples: Introduce code sample categories
This commit adds support for categorizing code samples in the
documentation.

It introduces two new directives:

- `zephyr:code-sample-category::` to create a category and associated
  brief description, that implicitly acts as a toctree too.

- `zephyr:code-sample-listing::` to allow dumping a list of samples
  corresponding to a category anywhere in the documentation.

Fixes #62453.

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2024-09-23 12:00:00 +02:00
Benjamin Cabé
47a7da9e9f doc: Overhaul doc guidelines
- Improved document structure (was *very* flat before) by adding more
  meaningful top-level headings and re-ordering some of the existing
  sections
- Provide detailed and structured docs for all the custom Sphinx roles
  and directives available in Zephyr, including moving the docs for
  ``.. zephyr-app-commands`` directive and `:dtcompatible:` roles away
  from the extensions' source files to align with how Sphinx typically
  handles docs for custom roles/directives.
- Added more content regarding diagrams guidelines, images,
  cross-referencing of Doxygen documentation, ...

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2024-09-18 15:31:39 +02:00
Benjamin Cabé
6cf5ac5879 doc: guidelines: drop mention of "any" links
Commit 204860857e (PR #41061) dropped
support for "any" as the default role, so this should be dropped from
the documentation guidelines as well.

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2024-09-13 11:42:51 -05:00
Benjamin Cabé
df294e34e1 doc: sphinx-lint: fix bad usage of "default role"
Fixes bad usage of single backticks in lieu of double backticks for
rendering inline literals, or simple '*' for italics.

When appropriate, a better construct than double backticks has been
selected (ex. :file:, :kconfig:option:, :c:func:, ...), or proper :ref:
have been used if the original intention was to have a link.

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2024-09-13 11:42:51 -05:00
Benjamin Cabé
b23f43c096 doc: generation: fix link to zephyr.tag
This link probably never worked. This commit fixes the relative
URL to properly point to where Doxygen docs live.

Fixes #78016.

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2024-09-05 17:12:32 -04:00
Fin Maaß
3887f41ef9 doc: fix links to wiki
This fixes the broken links to the zephyr wiki.

Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
2024-08-30 09:07:52 +02:00
Jordan Yates
2f143fb2c1 doc: add make html-live and html-live-fast
Add two new commands that automatically locally host the generated
documentation upon completion and rebuild/rehost when the input files
change without any user interaction.

For more info see: https://pypi.org/project/sphinx-autobuild/

Signed-off-by: Jordan Yates <jordan@embeint.com>
2024-08-26 17:05:39 +02: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
56a691078e doc: doc generation: remove breathe references
Remove the references to the breathe extension in the
Schematic of the documentation build process graph and
the filtering expected warnings section.

Signed-off-by: Simon Hein <Shein@baumer.com>
2024-08-21 18:27:04 +01:00
Benjamin Cabé
ef830d7a5e doc: fix 404 error with Zephyr project charter
The project charter has apparently changed location on
the main zephyrproject.org website.
This fixes a couple occurences of the old URL.

fixes #76433

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2024-07-31 10:07:11 +02:00
Declan Snyder
139a1cb803 doc: Make PR description a contributor expectation
Make a PR description an expectation/requirement for
pull requests submitted to the zephyr project.

Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
2024-07-18 16:27:23 -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
Anas Nashif
911df45d8e doc: update charter link
Update link to charter and use something more recent.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2024-06-11 20:24:02 +03:00
Benjamin Cabé
9ee3bf221d doc: pdf: add ImageMagick converter extension
Our documentation uses image formats such as WebP that are not supported
by LaTeX. This commit enables Sphinx's sphinx.ext.imageconverter
extension, and updates the documentation to indicate ImageMagick is
required to build docs.

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2024-06-10 14:58:16 +03:00
Gustavo Silva
9e2c773137 doc: improvements to Contribution Guidelines
Restructure the Contribution Guidelines page in the documentation.

Create the 'Pull Request Guidelines' section containing the best
practices for creating Pull Requests.

Improve commit message guidelines: instruct contributors to refer to
GitHub issue in the PR message instead of commit message when
submitting a fix; add a description of `Link:` tags for refering to
other relevant information.

Move 'clang-format' and 'twister' subsections to the new PR
Guidelines section.

Delete outdated/incorrect information about how to run tests locally
with twister.

Describe the `check_compliance.py` script as the recommended tool for
checking compliance of changes and how to run the script locally.
Remove 'gitlint' subsection.

Add a list of recommended steps for getting a new PR accepted quickly.

Signed-off-by: Gustavo Silva <gustavograzs@gmail.com>
2024-06-07 15:03:35 +02:00
David Leach
6f7fd7a306 doc: project roles: reviewer and assignee clarification
Clarification of reviewer expectations and role. Emphasis
on clarifying when a PR can be closed.

Highlighting reviewers and assignee objective to guide PR
to a mergeable state, if possible.

Signed-off-by: David Leach <david.leach@nxp.com>
2024-06-06 20:07:06 -04:00
Andrej Butok
a1ac84ca38 doc: Add upgrade flag to the install requirements command
- Adds -U upgrade flag to the install requirements command.
- Fixes a possible documentation generation issue,
  reported in https://github.com/zephyrproject-rtos/zephyr/issues/73082

Signed-off-by: Andrej Butok <andrey.butok@nxp.com>
2024-05-31 16:36:04 -05: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
Fabio Baltieri
e9dceed173 doc: guidelines: add a note about ascii and emojis
Add a note about source files encoding and emojis.

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2024-04-05 11:54:39 +02:00
Benjamin Cabé
36a9a9cee0 doc: guidelines: fix dead links
fix zephyr_file and zephyr_raw broken links

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2024-03-15 18:21:05 -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
Grzegorz Ferenc
ae0ad38e6b doc: contribute: fix heading formatting
Fixed several headings in the contribute section that were not following
the documentation guidelines for headings.

Signed-off-by: Grzegorz Ferenc <Grzegorz.Ferenc@nordicsemi.no>
2024-01-07 18:41:16 +01:00
Flavio Ceolin
dd58f80fe2 doc: Static Analysis requirement
Sets static analysis  an indispensable requirement for our project
releases.

Static analysis is not merely a tool but a proactive
strategy to unearth and address potential issues in the early stages
of development, long before they mature into critical
vulnerabilities. By scrutinizing code at rest, static analysis unveils
latent defects and potential security risks, thus bolstering the
resilience of our software against future threats.

Fixes: #64591

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2024-01-02 10:09:14 +01:00
Andrej Butok
7536021599 doc: blobs: fix double 'command'
Fix double 'command' in the "Fetching blobs" chapter.

Signed-off-by: Andrej Butok <andrey.butok@nxp.com>
2023-12-04 16:39:32 +00:00
Anas Nashif
538abf3332 doc: clarify role of CODEOWNERS and MAINTAINERS files
Change docs to use MAINTAINERS file as the main file for managing code
areas and 'ownership'.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2023-11-16 08:19:15 -05:00
Andrej Butok
287b30eb78 doc: Fix double 'the'
Fix double 'the' in all .rst documentation.

Signed-off-by: Andrej Butok <andrey.butok@nxp.com>
2023-11-15 14:25:11 +00:00
Jordan Yates
ee57b56ba5 doc: contribute: instructions for local viewing of docs
Add instructions for serving the generated HTML docs on a local IP
address.

Signed-off-by: Jordan Yates <jordan.yates@data61.csiro.au>
2023-11-07 09:54:22 +01:00
Anas Nashif
a6b490073e kernel: object: rename z_object -> k_object
Do not use z_ for internal structures and rename to k_object instead.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2023-11-03 11:46:52 +01:00
Fabio Baltieri
d89938f4b9 doc: guidelines: fix title level
Specialized driver requirements should have been one level up, it now
nests under "treewide".

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2023-10-31 16:33:04 +00:00