|
From: | Dirk Ziegelmeier |
Subject: | Re: [lwip-devel] Question regarding commit "Test / RFC: Reformat a few files using clang-format" |
Date: | Tue, 24 Jul 2018 08:23:33 +0200 |
Hi Dirk,
Here is my humble opinion:
1. The lwIP coding style is documented in doc/contrib.txt
2.1 Source code style
2.2 Source code documentation style
If the code follow the source code style in 2.1/2.2, it should be fine.
However, the clang-format commit seems add some more extra rules to
the coding style.
e.g. the number of characters per line, the while space changes, etc.
I think if you want to apply more rules, you need to update the 2.1
section first.
2. If lwIP want to enforce the consistent coding style, I think you
need a tool to check
the patch and source code file.
I used to work on linux kernel driver, and I found the
scripts/checkpatch.pl tool is
very uselful. I know the maintainer won't accept patch if
checkpatch.pl complains.
So even I might just read the coding style document for 1 or 2
times, I can easily
prepare a patch with good coding style by just checking if
checkpatch.pl complains.
Maybe such coding style checking tool is required by lwIP.
3. I do care about conflicts, so I would suggest improving the coding
style gradually.
i.e.
- Ensure new patches with good coding style.
- Ensure new files with good coding style.
- But don't enforce coding style for all source code with big-diff.
(Also note if there is a mistake in .clang-format, you will have
another big-diff to update the code which is not good).
One topic per patch. You might find maybe some of the code just
leave it as is if you are half-half about the changes.
[Prev in Thread] | Current Thread | [Next in Thread] |