@@ -46,6 +46,7 @@ public struct Configuration: Codable, Equatable {
4646 case noAssignmentInExpressions
4747 case multiElementCollectionTrailingCommas
4848 case reflowMultilineStringLiterals
49+ case indentBlankLines
4950 }
5051
5152 /// A dictionary containing the default enabled/disabled states of rules, keyed by the rules'
@@ -259,6 +260,13 @@ public struct Configuration: Codable, Equatable {
259260 }
260261
261262 public var reflowMultilineStringLiterals : MultilineStringReflowBehavior
263+
264+ /// Determines whether to add indentation whitespace to blank lines or remove it entirely.
265+ ///
266+ /// If true, blank lines will be modified to match the current indentation level:
267+ /// if they contain whitespace, the existing whitespace will be adjusted, and if they are empty, spaces will be added to match the indentation.
268+ /// If false (the default), the whitespace in blank lines will be removed entirely.
269+ public var indentBlankLines : Bool
262270
263271 /// Creates a new `Configuration` by loading it from a configuration file.
264272 public init ( contentsOf url: URL ) throws {
@@ -368,6 +376,10 @@ public struct Configuration: Codable, Equatable {
368376 self . reflowMultilineStringLiterals =
369377 try container. decodeIfPresent ( MultilineStringReflowBehavior . self, forKey: . reflowMultilineStringLiterals)
370378 ?? defaults. reflowMultilineStringLiterals
379+ self . indentBlankLines =
380+ try container. decodeIfPresent (
381+ Bool . self, forKey: . indentBlankLines)
382+ ?? defaults. indentBlankLines
371383
372384 // If the `rules` key is not present at all, default it to the built-in set
373385 // so that the behavior is the same as if the configuration had been
0 commit comments