mirror of
https://github.com/material-components/material-components-ios.git
synced 2026-02-20 08:27:32 +08:00
1.0 KiB
1.0 KiB
Code formatting tools
Objective-C and clang-format
We use clang-format to automatically format our Objective-C code. If you're going to be contributing more than a few one-off patches, then to reduce the time it takes to reveiw code, we suggest installing clang-format as an Xcode plugin and have it format your code whenever you write to disk.
Installing clang-format
You can install clang-format via Brew by running
scripts/install/install_clang_format.
Installing the Xcode plugin
You can install Travis Jeffery's clang-format Xcode plugin by following his installation instructions.
Once you've installed it configure it in Xcode:
Edit > Clang Format > Fileto use MDC's particular clang-format configuration file.Edit > Clang Format > Use System ClangFormatto ensure that you're using the same version of clang-format as we are.