Skip to content

Enforce bracket styles (Part 1) #86

@nehasingh2293

Description

@nehasingh2293

Related issues: #96, #100, #132, #135

Open brace should be on same line as statement

  • class
class SomeClass: SomeSuperClass {
}

class Demo {
}
  • function
func someMethod() {
}
  • conditional
if someCondition {
}

else if someCondition {
}

else {
}

switch someCase {
  default:
      break
}
  • loops
for var x = 0; x < 10; x+=1 {
}

for ; ; {
}

for var x ; ; {
}

for ; x ; {
}

for ; ; x {
}

for var x; x ; {
}

for var x; ; x {
}

for ; x ; x {
}

while someCondition {
}

repeat {
} while someCondition

for someElement in someCollection {
}
  • initializer
init(length:Double, breadth:Double) {
   self.length = length
   self.breadth = breadth
}
  • struct
struct DemoStruct : SomeParentStruct {
}

struct DemoStruct {
}

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions