-
Notifications
You must be signed in to change notification settings - Fork 806
ClangFormat
Code must be formatted with ClangFormat before a pull request is accepted.
There are several options to do this, and you must choose at least one:
Run this script before sending a pull request.
From the WinObjC repo root:
.\tools\scripts\pre-push.ps1 [upstream]
./tools/scripts/pre-push [upstream]
upstream - specify the upstream branch to diff against. The changed files in the diff will be formatted with clang format.
For example,
.\tools\scripts\pre-push.ps1 master
If no upstream is specified by argument, the script will try to auto-detect which branch is set as the upstream in git and use that.
If files were formatted, you will need to restage and recommit the files after running this script.
This is a hook that will run clang-format on all staged files before each commit.
Copy this file: \tools\scripts\pre-commit
To the directory: .git\hooks\
Stage files to commit and run "git commit." If there are files that were formatted, you will need to review, restage, and recommit the files.
This is a plugin for Visual Studio that allows running clang format on specific sections of code.
-
Close Visual Studio
-
Install Visual Studio plugin from this page http://llvm.org/builds/
-
Open Visual Studio
-
Open an objective-c file
-
Select the code to be formatted and either go to tools > ClangFormat, or Hit CTRL-R, then CTRL-F
Sublime can be set up to clang format on each file save.
See this page for more details: https://packagecontrol.io/packages/Clang%20Format
Settings for this package look like: Preferences > Package Settings > Clang Format > User specific
{
"binary": "C:\\Path\\to\\WinObjC\\msvc\\LLVM-3.6.0\\bin\\clang-format.exe",
"format_on_save": true,
"style": "File"
}
Project
Using the bridge
- Getting Started
- Using vsimporter
- Using the SDK
- Building From Source
- Adding Objective C to an Existing Project
- UI Guidance
- Changing the SDK Version of a Project
- Debugging
- Debugging Stack Traces from Crash Dumps
- Supported Third Party Libraries
- Creating and Linking Against C++ Static Libraries
- Packaging
Samples and Tutorials
- Quick Start Tutorial
- Building a To-Do List App
- Building a Calculator App
- Mixing and Matching UIKit and XAML
- IOS Bridge Samples Repo
Contributing
Links