Skip to content

Commit eb7e086

Browse files
fabiobaltiericfriedt
authored andcommitted
docs: contribution, style: specify that tabs are 8 characters
GitHub, in a moment of infinite wisdom, decided to change the default tab from eight to four characters. According to the GitHub announcement the problem that the change addressed is that "many users are unaware that tab size can be adjusted in their settings". As a result now users with this so called "improved" setting sees a different indentation from all other users. Help GitHub in their awareness mission, by making the users aware that tab size can (or rather, has to) be adjusted in their settings to the previous default, by mentioning it in the contribution guideline. Call it out in the quick style guide too since it's not the default anymore. Link: https://github.blog/changelog/2025-08-07-default-tab-size-changed-from-eight-to-four/ Signed-off-by: Fabio Baltieri <[email protected]>
1 parent fba3a1e commit eb7e086

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

doc/contribute/guidelines.rst

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -358,6 +358,19 @@ If in doubt, it's advisable to explore existing Pull Requests within the Zephyr
358358
repository. Use the search filters and labels to locate PRs related to changes
359359
similar to the ones you are proposing.
360360

361+
.. note::
362+
GitHub's default code UI uses 4-character tabs. However, Zephyr follows the
363+
`Linux kernel coding style`_, which uses 8-character tabs.
364+
365+
To ensure your view of the code is consistent with other developers, please
366+
go to your `user preferences on GitHub`_ and change the tab width to 8 spaces.
367+
368+
.. _Linux kernel coding style:
369+
https://kernel.org/doc/html/latest/process/coding-style.html#indentation
370+
371+
.. _user preferences on GitHub:
372+
https://github.com/settings/appearance
373+
361374
.. _commit-guidelines:
362375

363376
Commit Message Guidelines

doc/contribute/style/code.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ subsystem, etc).
1616
In general, follow the `Linux kernel coding style`_, with the following
1717
exceptions and clarifications:
1818

19+
* Tabs are 8 characters.
1920
* Use `snake case`_ for code and variables.
2021
* The line length is 100 columns or fewer. In the documentation, longer lines
2122
for URL references are an allowed exception.

0 commit comments

Comments
 (0)