Skip to content

Commit c293baf

Browse files
committed
docs: README update
1 parent 8da9570 commit c293baf

1 file changed

Lines changed: 25 additions & 5 deletions

File tree

README.md

Lines changed: 25 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,34 @@ XcodeFormat
88
[![Contact](https://img.shields.io/badge/follow-@macmade-blue.svg?logo=twitter&style=social)](https://twitter.com/macmade)
99
[![Sponsor](https://img.shields.io/badge/sponsor-macmade-pink.svg?logo=github-sponsors&style=social)](https://github.com/sponsors/macmade)
1010

11+
XcodeFormat automatically formats your source files when you save in Xcode.
12+
13+
It's a macOS menu-bar app paired with an Xcode Source Editor extension. By
14+
rebinding `cmd-s`, every save first runs your code through a formatter and then
15+
saves the file, so your style is enforced without any extra steps:
16+
17+
- **Swift** is formatted with [SwiftFormat](https://github.com/nicklockwood/SwiftFormat).
18+
- **C, C++, Objective-C and Objective-C++** are formatted with [uncrustify](https://github.com/uncrustify/uncrustify).
19+
20+
Both formatters are bundled inside the app, so there's nothing else to install.
21+
22+
Formatting is driven by named **configurations**. Each pairs a SwiftFormat
23+
config with an uncrustify config, and these can point to remote URLs that the
24+
app keeps up to date in the background — handy for sharing a single house style
25+
across a team.
26+
27+
The same engine is also available [from the command line](#command-line-usage),
28+
so you can format files outside Xcode — in scripts, build phases, or editor
29+
hooks.
30+
1131
### How to install
1232

1333
Quit Xcode.
1434

1535
Download the [latest release](https://github.com/macmade/XcodeFormat/releases/latest) and place the `.app` file in your `Applications` folder.
1636
Launch the application.
1737

18-
Open the `System Preferences`, navigate to the `Keyboard` section, and select `App Shortcuts` in the sidebar:
38+
Open `System Settings`, navigate to the `Keyboard` section, and select `App Shortcuts`:
1939

2040
![Screenshot](Assets/Screenshots/1-Keyboard-Shortcuts.png "Keyboard Shortcuts")
2141

@@ -25,16 +45,16 @@ Click the `+` button to add a new shortcut:
2545

2646
Choose `Xcode` as application, type `XcodeFormat` in `Menu Title` field, and set the shortcut to `cmd-s`.
2747

28-
From the `System Preferences`, navigate to the `Security & Privacy` section, and select `Accessibility` in the sidebar.
48+
From `System Settings`, navigate to the `Privacy & Security` section, and select `Accessibility`.
2949
Add Xcode to the list of applications and ensure the checkbox next to it is selected.
3050

3151
![Screenshot](Assets/Screenshots/3-Security-Accessibility.png "Security Accessibility")
3252

33-
From the `System Preferences`, ensure that `Xcode Source Editor` is enabled for the `Xcode Format` extension.
53+
From `System Settings`, ensure that `Xcode Source Editor` is enabled for the `Xcode Format` extension.
3454

3555
![Screenshot](Assets/Screenshots/4-Xcode-Source-Editor.png "Xcode Source Editor")
3656

37-
Open Xcode, go the the `Preferences` and navigate to the `Key Bindings` tab.
57+
Open Xcode, go to the `Preferences` and navigate to the `Key Bindings` tab.
3858
Search for `Save`, and choose a different shortcut for the save action (such as `cmd-ctrl-s`):
3959

4060
![Screenshot](Assets/Screenshots/5-Xcode-KeyBindings.png "Xcode KeyBindings")
@@ -49,7 +69,7 @@ Once a configuration is active, it will be used next time you save a file in Xco
4969
It is advised to keep this application running (and set it to start at login), as it will periodically update the configuration files from the supplied URLs.
5070

5171
An automator workflow will run every time you use the `cmd-s` shortcut.
52-
The worklow will trigger the `Editor > Xcode Format Extension > Format Current File` and `File > Save` menu items.
72+
The workflow will trigger the `Editor > Xcode Format Extension > Format Current File` and `File > Save` menu items.
5373

5474
### Command-line usage
5575

0 commit comments

Comments
 (0)