Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SceneKit overlay: format code #222

Merged
merged 1 commit into from
Dec 5, 2015
Merged

Conversation

ken0nek
Copy link
Contributor

@ken0nek ken0nek commented Dec 5, 2015

No description provided.

@landaire
Copy link

landaire commented Dec 5, 2015

This seems somewhat worse in my opinion. Is this formatting part of any style guide for Swift?

@ken0nek
Copy link
Contributor Author

ken0nek commented Dec 5, 2015

extension SCNMatrix4 definition is like below. (in the same file)

extension SCNMatrix4 {
  public init(_ m: float4x4) {
    self.init(
      m11: SCNFloat(m[0,0]), m12: SCNFloat(m[0,1]), m13: SCNFloat(m[0,2]), m14: SCNFloat(m[0,3]),
      m21: SCNFloat(m[1,0]), m22: SCNFloat(m[1,1]), m23: SCNFloat(m[1,2]), m24: SCNFloat(m[1,3]),
      m31: SCNFloat(m[2,0]), m32: SCNFloat(m[2,1]), m33: SCNFloat(m[2,2]), m34: SCNFloat(m[2,3]),
      m41: SCNFloat(m[3,0]), m42: SCNFloat(m[3,1]), m43: SCNFloat(m[3,2]), m44: SCNFloat(m[3,3]))
  }
  public init(_ m: double4x4) {
    self.init(
      m11: SCNFloat(m[0,0]), m12: SCNFloat(m[0,1]), m13: SCNFloat(m[0,2]), m14: SCNFloat(m[0,3]),
      m21: SCNFloat(m[1,0]), m22: SCNFloat(m[1,1]), m23: SCNFloat(m[1,2]), m24: SCNFloat(m[1,3]),
      m31: SCNFloat(m[2,0]), m32: SCNFloat(m[2,1]), m33: SCNFloat(m[2,2]), m34: SCNFloat(m[2,3]),
      m41: SCNFloat(m[3,0]), m42: SCNFloat(m[3,1]), m43: SCNFloat(m[3,2]), m44: SCNFloat(m[3,3]))
  }
}

In my opinion, aligning code vertically is better.

@tkremenek tkremenek assigned tkremenek and gribozavr and unassigned tkremenek Dec 5, 2015
gribozavr added a commit that referenced this pull request Dec 5, 2015
SceneKit overlay: format code
@gribozavr gribozavr merged commit 884df46 into swiftlang:master Dec 5, 2015
@gribozavr gribozavr changed the title Format code SceneKit overlay: format code Dec 5, 2015
dabelknap pushed a commit to dabelknap/swift that referenced this pull request Feb 13, 2019
…itespace

Demote CollectionLiteralWhitespace to a lint rule
kateinoigakukun added a commit to kateinoigakukun/swift that referenced this pull request Feb 25, 2020
maldahleh pushed a commit to maldahleh/swift that referenced this pull request Oct 26, 2020
build: explicitly specify python interpreter
freak4pc pushed a commit to freak4pc/swift that referenced this pull request Sep 28, 2022
Update project_precommit_check's 4.2 swiftlang version
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants