Open saghul opened 1 year ago
Yes, good idea.
I cobbled together a .clang-format that tries to hew close to the existing style but, even disregarding whitespace changes, it results in massive churn:
$ clang-format -i quickjs*.[ch] lib*.[ch] # clang-format 15
$ git diff --shortstat
14 files changed, 18373 insertions(+), 18470 deletions(-)
$ git diff --shortstat -w
13 files changed, 8272 insertions(+), 8369 deletions(-)
I'm generally not a fan of such changes but since pretty much have one file maybe it's a good time to do it now that it's early?
I don't disagree but I suspect the diff can be minimized with some further tweaking, I just ran out of time.
Let me investigate if I can tweak a clang-format
config file to match our style or find a more appropriate tool.
We should have a coding-rules.md
file to explain DOs and DON'Ts for patches to maintain consistency, which I consider very important.
Shall we create a clang-format config that roughly matches the current code, and enforce it with a linting CI?