Skip to content

Conversation

@norihiro
Copy link
Contributor

@norihiro norihiro commented Nov 1, 2025

Description

This PR adds a coding guideline to always have braces even for signle statements.

Motivation and Context

The coding style for Linux kernel requires no braces for a single statements.

However, the preference of this project is having braces even if the statement is single. I saw review comments like below several times.

How Has This Been Tested?

Check how it's rendered.

Types of changes

  • Documentation (a change to documentation pages)

Checklist:

  • My code has been run through clang-format.
  • I have read the contributing document.
  • My code is not on the master branch.
  • The code has been tested.
  • All commit messages are properly formatted and commits squashed where appropriate.
  • I have included updates to all appropriate documentation.

The coding style for Linux kernel requires no braces for a single
statements. However, the preference of this project is having braces
even if the statement is single.
@Penwy
Copy link
Contributor

Penwy commented Nov 1, 2025

If that is to become a required guideline, then I think it would be worth also adding a commit to add braces around all the currently unbraced single statements in the code (as far as I can see, clang-tidy can automate that).

@Fenrirthviti
Copy link
Member

There is an internal draft of a significantly updated contribution guidelines that will be submitted in the next few weeks. We're aware of the pain points that current guidelines are a bit lacking.

As we have a working draft, I will close this, but thank you for the submission!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants