From 12192440863db4600d36db0f26975f9e1aa21b00 Mon Sep 17 00:00:00 2001 From: Nagasawa Hiroki Date: Wed, 6 Mar 2019 10:23:21 +0000 Subject: [PATCH 1/4] Remove @ mark to fix invalid link --- Rules.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Rules.md b/Rules.md index c630e787cc..89ec9b14df 100644 --- a/Rules.md +++ b/Rules.md @@ -116,7 +116,7 @@ * [Quick Discouraged Pending Test](#quick-discouraged-pending-test) * [Redundant Discardable Let](#redundant-discardable-let) * [Redundant Nil Coalescing](#redundant-nil-coalescing) -* [Redundant @objc Attribute](#redundant-@objc-attribute) +* [Redundant @objc Attribute](#redundant-objc-attribute) * [Redundant Optional Initialization](#redundant-optional-initialization) * [Redundant Set Access Control Rule](#redundant-set-access-control-rule) * [Redundant String Enum Value](#redundant-string-enum-value) From 92efeac3f1dfb11f95bac7d51265eaa3ad8631e5 Mon Sep 17 00:00:00 2001 From: Nagasawa Hiroki Date: Sat, 9 Mar 2019 16:33:53 +0000 Subject: [PATCH 2/4] Revert "Remove @ mark to fix invalid link" This reverts commit 12192440863db4600d36db0f26975f9e1aa21b00. --- Rules.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Rules.md b/Rules.md index 89ec9b14df..c630e787cc 100644 --- a/Rules.md +++ b/Rules.md @@ -116,7 +116,7 @@ * [Quick Discouraged Pending Test](#quick-discouraged-pending-test) * [Redundant Discardable Let](#redundant-discardable-let) * [Redundant Nil Coalescing](#redundant-nil-coalescing) -* [Redundant @objc Attribute](#redundant-objc-attribute) +* [Redundant @objc Attribute](#redundant-@objc-attribute) * [Redundant Optional Initialization](#redundant-optional-initialization) * [Redundant Set Access Control Rule](#redundant-set-access-control-rule) * [Redundant String Enum Value](#redundant-string-enum-value) From 8fa2d0bcfc5c2b47f42874ad2366d60f4f49be98 Mon Sep 17 00:00:00 2001 From: Nagasawa Hiroki Date: Sat, 9 Mar 2019 17:11:41 +0000 Subject: [PATCH 3/4] Remove punctuation from anchor --- Rules.md | 2 +- .../Models/RuleList+Documentation.swift | 10 +++++++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/Rules.md b/Rules.md index c630e787cc..89ec9b14df 100644 --- a/Rules.md +++ b/Rules.md @@ -116,7 +116,7 @@ * [Quick Discouraged Pending Test](#quick-discouraged-pending-test) * [Redundant Discardable Let](#redundant-discardable-let) * [Redundant Nil Coalescing](#redundant-nil-coalescing) -* [Redundant @objc Attribute](#redundant-@objc-attribute) +* [Redundant @objc Attribute](#redundant-objc-attribute) * [Redundant Optional Initialization](#redundant-optional-initialization) * [Redundant Set Access Control Rule](#redundant-set-access-control-rule) * [Redundant String Enum Value](#redundant-string-enum-value) diff --git a/Source/SwiftLintFramework/Models/RuleList+Documentation.swift b/Source/SwiftLintFramework/Models/RuleList+Documentation.swift index 19d1b509a1..df6d0c71ab 100644 --- a/Source/SwiftLintFramework/Models/RuleList+Documentation.swift +++ b/Source/SwiftLintFramework/Models/RuleList+Documentation.swift @@ -88,7 +88,15 @@ extension RuleList { } private func summaryItem(_ text: String) -> String { - let anchor = text.lowercased().components(separatedBy: .whitespaces).joined(separator: "-") + var allowed = CharacterSet() + allowed.formUnion(.letters) + allowed.formUnion(.decimalDigits) + allowed.formUnion(.whitespaces) + allowed.insert(charactersIn: "-") + + let anchor = text.lowercased() + .components(separatedBy: allowed.inverted).joined() + .components(separatedBy: .whitespaces).joined(separator: "-") return "* [\(text)](#\(anchor))\n" } } From ddce88fb61878908e53daf5c73f7121775a7c5a4 Mon Sep 17 00:00:00 2001 From: Nagasawa Hiroki Date: Sat, 9 Mar 2019 17:45:32 +0000 Subject: [PATCH 4/4] Update CHANGELOG.md --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index ff7d461726..569b3ef203 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,6 +16,10 @@ [Matthew Healy](https://github.com/matthew-healy) [#2663](https://github.com/realm/SwiftLint/pull/2663) +* Remove @ mark to fix invalid link in Rules.md. + [Hiroki Nagasawa](https://github.com/pixyzehn) + [#2669](https://github.com/realm/SwiftLint/pull/2669) + #### Bug Fixes * `colon` rule now catches violations when declaring generic types with