JonathanSalwan / Triton

Triton is a dynamic binary analysis library. Build your own program analysis tools, automate your reverse engineering, perform software verification or just emulate code.
https://triton-library.github.io
Apache License 2.0
3.4k stars 524 forks source link

Add .clang-format to the project #1267

Open ZehMatt opened 11 months ago

ZehMatt commented 11 months ago

It would be really nice to have this, the format is quite mixed and would help contributors think less about the code style and focus more on the technical aspect. One example would be context.cpp and context.hpp, context.hpp has the tab size of 4 where context.cpp has the tab size of 2.

JonathanSalwan commented 10 months ago

Great idea. Can you make a PR for this one? :)

ZehMatt commented 10 months ago

Great idea. Can you make a PR for this one? :)

Can do, can you name me a file which I should base the format configuration on? Also should I format the entire code base at once or just drop in the .clang-format file and let whoever touches the file do that at the end? Some people also care quite a bit about the commit history and tend to not clang-format every file all at once. Definitely a good change in the long term in my opinion.

JonathanSalwan commented 10 months ago

Can do, can you name me a file which I should base the format configuration on?

Let's try first with this file.

Also should I format the entire code base at once or just drop in the .clang-format file and let whoever touches the file do that at the end?

I think for a first step, we could try with a very light clang format. The problem is that I care more about readability than strict coding style :)

Maybe we can try to write a clang format that matches the previous file I linked and then see how it goes on the whole code base?