Commit graph

26 commits

Author SHA1 Message Date
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
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
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
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
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
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
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
Fabio Baltieri
d933e7417f doc: guidelines: add a note about specialized drivers
Add a note about requirements for specialized drivers, clarifying the
requirements about using Zephyr APIs.

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2023-10-20 15:19:58 +02:00
Flavio Ceolin
05fb54b090 doc: security: Update info about tools
Since there are multiple static analysis tools being used
now, it is better to change references for a particular one
and just point to static analysis section in the documentation.

JIRA is no longer used for tracking security issues. Update it
to Github.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2023-10-20 15:11:01 +02:00
Benjamin Cabé
620f6b9a6d doc: guidelines: remove stale mention to nightly builds
Drop the mention to nightly builds being posted to the build@ mailing
list.

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2023-10-06 09:28:10 +02:00
Fabio Baltieri
bef540b178 doc: guidelines: add an item about avoiding binary literals
Add an item to the coding style list asking to avoid using binary
literals.

Link: https://github.com/zephyrproject-rtos/zephyr/issues/61798
Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2023-08-24 10:21:12 +02:00
Anas Nashif
c1e40bb3d5 templates: change template file namaes for proper sorting
prefix with numbers to get sorting based on usage. Most common files
issue types should come first, with bugs being at the top.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2023-06-08 07:32:45 -04:00
Anas Nashif
d17d28aa58 doc: add a section about coverity scans
Quick intro into static code analysis and scans.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2023-06-07 16:55:48 +02:00
Fabio Baltieri
eec4b2336c doc: drop the topic branch references from the contribution guideline
Topic branches are not in widespread use and the details on how are
managed are being reworked.

Drop the topic branches reference (now being renamed "collab" branches)
from the contribution guideline and just ask to open PRs against main,
as that's the common case right now, saves first time users from having
to dig through the various branches in the repository.

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2023-05-12 09:59:56 +02:00
Keith Short
34165a3480 docs: Add Contributor Expectations document
Collect up all the contributor expectations and PR requirements into a
single place. Add additional guidelines about creating small PRs and how
to break up PRs into multiple commits.

Signed-off-by: Keith Short <keithshort@google.com>
2023-03-06 21:59:23 +01:00
Keith Short
767972355f docs: Make 100 column limit for code explicit
Zephyr's coding style is based on the Linux kernel coding style, which
indicates a preferred limit of 80 columns. Zephyr's .clang-format sets
the ColumnLimit to 100. Update the documentation to match the
.clang-format parameters.

Signed-off-by: Keith Short <keithshort@google.com>
2023-02-21 13:05:54 -05:00
Marti Bolivar
4c9e5f7bf2 doc: contribute: improve "Commit Guidelines" section
The current content does have all the critical information, but you
have to read carefully to catch several important details. This makes
it less likely that people will be able to follow the rules, which
wastes maintainers' time in PRs from new contributors, since we have
to explain the details repeatedly.

Fix it by making the introduction shorter while still covering all the
bases, and adding details with more concrete examples in the following
subsections.

Keep some other text in the document up to date and fix some
cross-references as needed.

Signed-off-by: Marti Bolivar <marti.bolivar@nordicsemi.no>
2023-02-08 15:03:56 -08:00
Anas Nashif
e5adeef105 doc: contribute: adapt twister section
Adapt twister section in the contribution guidelines.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2023-01-31 12:25:58 -08:00
Fabio Baltieri
7a9b019f46 doc: contribute: add a note about the GitHub "Update branch" feature
Add a note about the "branch out of date" and "Update branch" GitHub
feature. That message is confusing for new users and we often see people
losing approvals and introducing merge commits with it. Adding a note
in the contribution guidelines would hopefully help some.

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2022-12-21 12:18:22 +01:00
Fabio Baltieri
f781788ece doc: contribute: drop the point about subsystem branches
There hasn't been any topic branch in widespread use. This point is
still relevant for backports or some advanced usage, but since this list
is meant to help contributor approaching the project it may be a good
idea to drop the point and make the list a tiny bit shorter and less
intimidating.

Instead, mention that main should be used "if unsure" in the previous
point.

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2022-12-21 12:18:22 +01:00
Martí Bolívar
e041b2f5da doc: treewide change requirements
This pull request documents additional requirements for treewide
changes which were discussed at the process WG (see
issue #48886 for details).

These requirements apply to especially impactful changes. They exist
both to try to make sure the changes get enough review, and to give
users a heads-up mechanism about incoming treewide changes.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2022-11-02 14:33:56 +01:00
Mr. Green's Workshop
5772af2eb4 doc: commit description line limit added.
There wasn't any description for line length limit per line.
Description added.

Signed-off-by: Mr. Green's Workshop <info@mrgreensworkshop.com>
2022-07-19 07:36:20 -04:00
Gerard Marull-Paretas
c7e4388b1d doc: contribute: guidelines: replace uncrustify with clang-format
Prefer clang-format over uncrustify for source code formatting.
uncrustify configuration files will be removed in future commits.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-06-15 09:37:30 -04:00
Carles Cufi
ae3e29a230 doc: Move the source tree description out of app development
It is quite confusing to describe Zephyr's source tree layout in the
section for application development, given that applications do not need
to follow the exact same layout as the main tree.
Instead move this section to the contribution guidelines chapter.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2022-05-23 10:16:04 +02:00
Anas Nashif
f09948b68a doc: restructre contribution section
The contribution guide gets a new structure and contains all
contribution guidelines in one place.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2022-04-07 16:35:19 +02:00