Closed philipportner closed 2 months ago
Thx for initiating discussion on coding style :+1: We've been avoiding it for far too long ;-) :see_no_evil:
To ignore whitespace changes with git blame
one has to pass the -w
option as argument, e.g., git blame -w path_to_file
.
This PR is related to #70 and perhaps to #16.
In the future, please add a reference to the GitHub discussion to the commit message before merging to main. Something like "[DAPHNE-#723] Introduce .clang-format file"
And maybe we could have a mention in the contribution guidelines on how to use it :nerd_face:
And maybe we could have a mention in the contribution guidelines on how to use it 🤓
Yes, I'll do that. Thanks
This PR aims to introduce a
.clang-format
file in order to have automated consistent code formatting for supported languages. For DAPHNE this mainly aims to do so for C, C++ and TableGen files.clang-format
is the standard tool to provide consistent formatting across C and C++ code bases and is supported by almost every editor and IDE out there (e.g., automatically recognized by Clion/VScode).It even has integration with
git
itself.The following steps would need to be completed:
clang-format
on whole projectI don't really care which format we use, main thing is consistency. I added the
LLVM
style for now since that makes the most sense for me with our dependency on LLVM.Happy to discuss specifics and feel free to ask any questions and please let me know if there's more steps needed.
https://clang.llvm.org/docs/ClangFormat.html