I have a bunch of C code whose function names are in CamelCase and I have to convert them all to snake_case.
I found that there is a tool call clang-tidy
that seems to be able to do this but I can't make sense of the documentation, there are a lot of options and I am afraid to shoot myself in the foot.
Would you be kind enough to provide me with a one liner ?
Here is the one liner just to rename functions :
The purpose of
--fix
is to apply changes, else you will just have a bunch of warnings.Config is YAML. You can dump the config into a
.clang-tidy
file and clang tidy will use that.There are other options for renaming variables, structs... You name it : https://sarcasm.github.io/notes/dev/clang-tidy.html#identifier-naming