Format.cmake icon indicating copy to clipboard operation
Format.cmake copied to clipboard

Problem: clang-format application can be overzealous

Open yrashk opened this issue 1 year ago • 6 comments

Solution: allow excluding certain paths by specifying them in the CLANG_FORMAT_IGNORED_PATHS list


This is just a quick solution to a problem I had with a lot of vendored dependencies in the repo where I needed this. Happy to discuss if there's a better solution!

yrashk avatar Oct 15 '24 12:10 yrashk

What is your use case? It should do the same like git clang-format

ClausKlein avatar Oct 16 '24 14:10 ClausKlein

@yrashk could it be a better solution to add a .clang-format-ignore file that includes the vendored dependency directory? For example as described in this post.

TheLartians avatar Oct 16 '24 14:10 TheLartians

But than you need to update your copy of clang-format.py to llvm v18 or newer!

ClausKlein avatar Oct 16 '24 20:10 ClausKlein

And that would require clang-format to be of a newer version, too! 😀

yrashk avatar Oct 16 '24 23:10 yrashk

@TheLartians first off all the CI Must be fixed!

And https://github.com/TheLartians/Format.cmake/issues/41 should be merged 😮

ClausKlein avatar Oct 17 '24 09:10 ClausKlein

Sorry, the CI issue should be fixed now if you merge with main. I'm happy with using newer versions of the according formatting tools, but also with adding the suggested flag for scenarios where this is not possible. (also apologies for taking so long to respond, very busy atm)

TheLartians avatar Dec 22 '24 12:12 TheLartians