WebAssembly / WebAssembly/wabt

C++ coding style is not documented

Open
#1,273 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C++
Stars
8.1k
Forks
827
Avg merge
4d 6h
Merged PRs (30d)
18

Description

Ran into this issue when reviewing some recent additions.

Currently the only documentation I could find was that we specify BasedOnStyle: Chromium in .clang-format. This implicitly locks down a lot of things which good, more explicit docs would be good.

The specific issue we ran into was the wabt uses a style that requires curly braces around conditional blocks, but chromium, which inherits from google style allows from single line conditional, and conditional without curlys:
https://google.github.io/styleguide/cppguide.html#Conditionals
In general, curly braces are not required for single-line statements

We should be specific if we want to enforce this style.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the repository's .clang-format and compare its BasedOnStyle: Chromium setting with the linked Chromium C++ style guidance. Document the intended C++ style, including the conditional-brace rule raised in the issue, and consider other implicit choices that should be explicit. Done means contributors and reviewers can find and apply the documented conventions.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
documentation
Issue type
Documentation
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.