From d064177cdd416bafece590487dbafbec2cbfe733 Mon Sep 17 00:00:00 2001 From: JP Simard Date: Sun, 28 Jul 2019 15:56:59 -0700 Subject: [PATCH] Fix `swiftlinit rules` output table formatting Fixes https://github.com/realm/SwiftLint/issues/2787 Broken since https://github.com/realm/SwiftLint/pull/2379 --- CHANGELOG.md | 4 ++++ Source/swiftlint/Commands/RulesCommand.swift | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d31da5faeb..87debe01c1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -18,6 +18,10 @@ [Colton Schlosser](https://github.com/cltnschlosser) [#2812](https://github.com/realm/SwiftLint/issues/2812) +* Fix `swiftlinit rules` output table formatting. + [JP Simard](https://github.com/jpsim) + [#2787](https://github.com/realm/SwiftLint/issues/2787) + ## 0.34.0: Anti-Static Wool Dryer Balls #### Breaking diff --git a/Source/swiftlint/Commands/RulesCommand.swift b/Source/swiftlint/Commands/RulesCommand.swift index f0efddc69e..ac69cc9b96 100644 --- a/Source/swiftlint/Commands/RulesCommand.swift +++ b/Source/swiftlint/Commands/RulesCommand.swift @@ -122,7 +122,7 @@ extension TextTable { func truncate(_ string: String) -> String { let stringWithNoNewlines = string.replacingOccurrences(of: "\n", with: "\\n") let minWidth = "configuration".count - "...".count - let configurationStartColumn = 112 + let configurationStartColumn = 124 let truncatedEndIndex = stringWithNoNewlines.index( stringWithNoNewlines.startIndex, offsetBy: max(minWidth, Terminal.currentWidth() - configurationStartColumn),