Conversation
|
Having a coding convention setting file is a good idea, but after playing around with
You've pretty much summarised what we also want, which is that if we don't specify a setting, it should be ignored and accepted as is. So for example, if we only want to start with basic indentation convention (such as tab, indent width, and column width) and add more later, we should be able to do that. But with clang-format, if you don't specify a style a default will be chosen, so all style settings will be taken into account during formatting. This triggers a lot of warning for our existing codebase ( In general, if we are to use a code formatter, it should be clean (or produce only minimal warnings) when we run |
|
I use vscode edit code, it can format the selected code, which will not chang the format of a whole file. Prepare:
Now you can use mouse select some code, and click right, in the menu click "Format Selection" ^_^ |
|
Ah, that makes sense. Unfortunately the .clang-format will fail the rest of PJSIP code :) |
modify 'UseTab' style
|
We decide to proceed with #3210. Thanks for the suggestion. |
Use clang-format to help format code.
It could help contributors and avoid useless code style reviews.
According to Coding Convention.
This only contains basic functions, It can be expanded on this basis, add other features.
#3115