Skip to content

Conversation

@wenyongh
Copy link
Contributor

Customize clang-format coding styles based on Mozilla template.
To check if source codes are well formatted:

$ cd ${wamr-root}
$ clang-format --Werror --dry-run --style=file path/to/file

To format source codes in place

$ cd ${wamr_root}
$ clang-format -i --style=file path/to/file

Signed-off-by: Wenyong Huang wenyong.huang@intel.com

Merge bytecodealliance:main into wenyongh:main
zephyr: add module.yml and fix riscv compile error (#763)
Merge bytecodealliance:main into wenyongh:main
Customize clang-format coding styles based on Mozilla template.
To check if source codes are well formatted:
``` bash
$ cd ${wamr-root}
$ clang-format --Werror --dry-run --style=file path/to/file
```
To format source codes in place
``` bash
$ cd ${wamr_root}
$ clang-format -i --style=file path/to/file
```
@no1wudi
Copy link
Collaborator

no1wudi commented Oct 5, 2021

I see some sources don't follow the code style defined in .clang-format, is there any plan to re-format whole project with .clang-format

@wenyongh wenyongh merged commit 7191ecf into bytecodealliance:main Oct 6, 2021
wenyongh referenced this pull request in wenyongh/wasm-micro-runtime Oct 6, 2021
Customize clang-format coding styles based on Mozilla template (#770)
@wenyongh
Copy link
Contributor Author

wenyongh commented Oct 6, 2021

I see some sources don't follow the code style defined in .clang-format, is there any plan to re-format whole project with .clang-format

Yes, as the project becomes bigger and bigger, it is really hard to check the code styles manually, we hope to automatically check it with CI rules when PR is created. Now we plan to re-format all the C/C++ source files by the clang-format tool with the customized format, and then add the code style check step to CI rules. I have submitted another PR to format the interpreter source files and more formatting for other files are WIP, could you please help check whether it is OK? Almost all the codes can be well-formatted except several places, in which we use /* clang-format off */... /* clang-format on */ to disable clang-format and change the codes by ourselves.

vickiegpt pushed a commit to vickiegpt/wamr-aot-gc-checkpoint-restore that referenced this pull request May 27, 2024
…odealliance#770)

Customize clang-format coding styles for C source files based on Mozilla template.
To check whether the C source codes are well formatted:
``` bash
$ cd ${wamr-root}
$ clang-format --Werror --dry-run --style=file path/to/file
```
To format the C source codes in place
``` bash
$ cd ${wamr_root}
$ clang-format -i --style=file path/to/file
```

Signed-off-by: Wenyong Huang <wenyong.huang@intel.com>
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.

2 participants