How to call clang-format over a cpp project folder?

后端 未结 9 2160
眼角桃花
眼角桃花 2021-01-29 21:43

Is there a way to call something like clang-format --style=Webkit for an entire cpp project folder, rather than running it separately for each file?

I am us

9条回答
  •  遇见更好的自我
    2021-01-29 22:05

    When you use Windows (CMD) but don't want to use the PowerShell cannon to shoot this fly, try this:

    for /r %t in (*.cpp *.h) do clang-format -i -style=WebKit "%t"
    

    Don't forget to duplicate the two %s if in a cmd script.

提交回复
热议问题