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

One blank line between declarations #905

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

ValentinWalter
Copy link

@ValentinWalter ValentinWalter commented Dec 18, 2024

This adds a new configuration option (oneBlankLineBetweenDeclarations) to make the pretty printer add a blank line between declarations that are either multiline, or have differing declaration modifiers. This works at the file scope as well. Here's an example:

typealias A = Int
typealias B = String
class A {
  private static var x1: Int
  private static var x2: Int
  var y1: Int
  var y2: Int
  private var z1: Int
  private var z2: Int
  static var w1: Int
  static var w2: Int
}

Becomes this:

typealias A = Int
typealias B = String
+
class A {
  private static var x1: Int
  private static var x2: Int
+
  var y1: Int
  var y2: Int
+
  private var z1: Int
  private var z2: Int
+
  static var w1: Int
  static var w2: Int
}

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.

1 participant