travisjeffery / ClangFormat-Xcode

Xcode plug-in to to use clang-format from in Xcode and consistently format your code with Clang
https://twitter.com/travisjeffery
MIT License
2.89k stars 288 forks source link

Where should I put .clang-format? #50

Closed nick-ma closed 9 years ago

nick-ma commented 9 years ago

I have used ./clang-format -style=llvm -dump-config > .clang-format to extract a config file and made some modifications, then I have tried to put the .clang-format file in ~/Library/Application Support/Developer/Shared/Xcode/Plug-ins/ClangFormat.xcplugin/Contents/Resources and XCode project root directry, but it seems take no effect.

Where should I put the config file?

travisjeffery commented 9 years ago

xcode project root should work (i.e. in the directory that contains the .xcodeproj), or you could put it at ~/.clang-format. basically the plugin looks at the directory containing the files and then traverses upwards until it finds a .clang-format file or hits /

nick-ma commented 9 years ago

I put it into my home directory, and it works! Thank you!