-
Notifications
You must be signed in to change notification settings - Fork 9.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add .clang-format file #10292
Add .clang-format file #10292
Conversation
5a68676
to
f36ecea
Compare
I believe that having a |
I agree. I find it particularly handy I can bounce around multiple codebases throughout any given year and it's very hard to remember the style nuances and quickly write code. git clang-format is very good at just styling sections, so we don't have to apply globally. @slaren if I copy paste this one: ggml/src/ggml-cann/.clang-format and change PointerAlignment to middle we should be good? |
I don't know, but I wouldn't expect so. The CANN backend has its own style that is not likely to be based on the core ggml/llama.cpp style. We tend to use lots of vertical alignment as well. |
For me the vertical alignment is really important. If we find a way to make it compatible with |
I don't expect that we will be able to replicate exactly the same style (we don't even have a well-defined style in the first place), but it has a quite a few options for alignment. https://clang.llvm.org/docs/ClangFormatStyleOptions.html |
Not opinionated on what it looks like but I do want a .clang-format file so I can worry about manually modifying style less. Would it be easier for you guys to open a PR or will I keep iterating? |
Yes, these look like what we need. @ericcurtin Start by copying the |
f36ecea
to
1842922
Compare
Sorry I closed this PR by mistake and it became unreopenable, new one here: |
So people can use things like clang-format and git clang-format to
style their code. Copied from ggml-cann, with PointerAlignment
changed to Middle.