Skip to content

Commit f671532

Browse files
committed
Fixes for brackets not being on the same line as if / else
1 parent 43a74bd commit f671532

File tree

2 files changed

+15
-30
lines changed

2 files changed

+15
-30
lines changed

SwiftyJSONAccelerator/SJEditorViewController.swift

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -126,21 +126,17 @@ class SJEditorViewController: NSViewController, NSTextViewDelegate {
126126
let supportSwiftyState = self.supportSwiftyJSONCheckbox?.state == 1 ? true : false
127127
let supportObjectMapperState = self.supportObjectMapperCheckbox?.state == 1 ? true : false
128128

129-
if supportSwiftyState
130-
{
129+
if supportSwiftyState {
131130
self.includeSwiftyCheckbox?.enabled = true
132131
}
133-
else
134-
{
132+
else {
135133
self.includeSwiftyCheckbox?.enabled = false
136134
}
137135

138-
if supportObjectMapperState
139-
{
136+
if supportObjectMapperState {
140137
self.includeObjectMapperCheckbox?.enabled = true
141138
}
142-
else
143-
{
139+
else {
144140
self.includeObjectMapperCheckbox?.enabled = false
145141
}
146142
}

SwiftyJSONAccelerator/SJModelGenerator.swift

Lines changed: 11 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -212,32 +212,26 @@ public class ModelGenerator {
212212
content = content.stringByReplacingOccurrencesOfString("{STRING_CONSTANT_BLOCK}", withString: stringConstants)
213213
content = content.stringByReplacingOccurrencesOfString("{PROPERTIES}", withString: declarations)
214214

215-
if self.supportNSCoding
216-
{
217-
if let nscodingBase = try? String(contentsOfFile: NSBundle.mainBundle().pathForResource("NSCodingTemplate", ofType: "txt")!)
218-
{
215+
if self.supportNSCoding {
216+
if let nscodingBase = try? String(contentsOfFile: NSBundle.mainBundle().pathForResource("NSCodingTemplate", ofType: "txt")!) {
219217
content = content.stringByReplacingOccurrencesOfString("{NSCODING_PROTOCOL_SUPPORT}", withString: ", NSCoding")
220218
content = content.stringByReplacingOccurrencesOfString("{NSCODING_SUPPORT}", withString: nscodingBase)
221219

222220
content = content.stringByReplacingOccurrencesOfString("{ENCODERS}", withString: encoders)
223221
content = content.stringByReplacingOccurrencesOfString("{DECODERS}", withString: decoders)
224222
}
225-
else
226-
{
223+
else {
227224
content = content.stringByReplacingOccurrencesOfString("{NSCODING_PROTOCOL_SUPPORT}", withString: "")
228225
content = content.stringByReplacingOccurrencesOfString("{NSCODING_SUPPORT}", withString: "")
229226
}
230227
}
231-
else
232-
{
228+
else {
233229
content = content.stringByReplacingOccurrencesOfString("{NSCODING_PROTOCOL_SUPPORT}", withString: "")
234230
content = content.stringByReplacingOccurrencesOfString("{NSCODING_SUPPORT}", withString: "")
235231
}
236232

237-
if self.supportSwiftyJSON
238-
{
239-
if let swiftyBase = try? String(contentsOfFile: NSBundle.mainBundle().pathForResource("SwiftyJSONTemplate", ofType: "txt")!)
240-
{
233+
if self.supportSwiftyJSON {
234+
if let swiftyBase = try? String(contentsOfFile: NSBundle.mainBundle().pathForResource("SwiftyJSONTemplate", ofType: "txt")!) {
241235
content = content.stringByReplacingOccurrencesOfString("{SWIFTY_JSON_SUPPORT}", withString: swiftyBase)
242236

243237
content = content.stringByReplacingOccurrencesOfString("{INITALIZER}", withString: initalizers)
@@ -248,22 +242,18 @@ public class ModelGenerator {
248242
content = content.stringByReplacingOccurrencesOfString("{INCLUDE_SWIFTY}", withString: "")
249243
}
250244
}
251-
else
252-
{
245+
else {
253246
content = content.stringByReplacingOccurrencesOfString("{SWIFTY_JSON_SUPPORT}", withString: "")
254247
content = content.stringByReplacingOccurrencesOfString("{INCLUDE_SWIFTY}", withString: "")
255248
}
256249
}
257-
else
258-
{
250+
else {
259251
content = content.stringByReplacingOccurrencesOfString("{SWIFTY_JSON_SUPPORT}", withString: "")
260252
content = content.stringByReplacingOccurrencesOfString("{INCLUDE_SWIFTY}", withString: "")
261253
}
262254

263-
if self.supportObjectMapper
264-
{
265-
if let objectMapperBase = try? String(contentsOfFile: NSBundle.mainBundle().pathForResource("ObjectMapperTemplate", ofType: "txt")!)
266-
{
255+
if self.supportObjectMapper {
256+
if let objectMapperBase = try? String(contentsOfFile: NSBundle.mainBundle().pathForResource("ObjectMapperTemplate", ofType: "txt")!) {
267257
content = content.stringByReplacingOccurrencesOfString("{OBJECT_MAPPER_SUPPORT}", withString: objectMapperBase)
268258

269259
content = content.stringByReplacingOccurrencesOfString("{OBJECT_MAPPER_INITIALIZER}", withString: objectMapperMappings)
@@ -276,8 +266,7 @@ public class ModelGenerator {
276266
content = content.stringByReplacingOccurrencesOfString("{INCLUDE_OBJECT_MAPPER}", withString: "")
277267
}
278268
}
279-
else
280-
{
269+
else {
281270
content = content.stringByReplacingOccurrencesOfString("{OBJECT_MAPPER_SUPPORT}", withString: "")
282271
content = content.stringByReplacingOccurrencesOfString("{INCLUDE_OBJECT_MAPPER}", withString: "")
283272
}

0 commit comments

Comments
 (0)