From b145d666d05823f680f93ab5b4fbbfa4f2905173 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cihat=20Gu=CC=88ndu=CC=88z?= Date: Wed, 27 Mar 2019 11:03:04 +0100 Subject: [PATCH] Fix issues after rebasing to master --- CHANGELOG.md | 19 ++++++++------- Rules.md | 24 +++++++------------ .../FileTypesOrderConfiguration.swift | 2 -- .../TypeContentsOrderConfiguration.swift | 2 -- .../Style/FileTypesOrderRuleExamples.swift | 2 -- .../Rules/Style/TypeContentsOrderRule.swift | 1 - .../Style/TypeContentsOrderRuleExamples.swift | 2 -- 7 files changed, 18 insertions(+), 34 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3e8883b0ee..7a456f2142 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -24,6 +24,16 @@ [Hiroki Nagasawa](https://github.com/pixyzehn) [#2669](https://github.com/realm/SwiftLint/pull/2669) +* Add new opt-in rule `file_types_order` to specify how the types in a file + should be sorted. + [Cihat Gündüz](https://github.com/Dschee) + [#2294](https://github.com/realm/SwiftLint/issues/2294) + +* Add new opt-in rule `type_contents_order` to specify the order of subtypes, + properties, methods & more within a type. + [Cihat Gündüz](https://github.com/Dschee) + [#2294](https://github.com/realm/SwiftLint/issues/2294) + #### Bug Fixes * `colon` rule now catches violations when declaring generic types with @@ -82,15 +92,6 @@ * Add `exclude_ranges` option to `number_separator` for exclusion. [Cihat Gündüz](https://github.com/Dschee) [#2637](https://github.com/realm/SwiftLint/issues/2637) -* Add new opt-in rule `file_types_order` to specify how the types in a file - should be sorted. - [Cihat Gündüz](https://github.com/Dschee) - [#2294](https://github.com/realm/SwiftLint/issues/2294) - -* Add new opt-in rule `type_contents_order` to specify the order of subtypes, - properties, methods & more within a type. - [Cihat Gündüz](https://github.com/Dschee) - [#2294](https://github.com/realm/SwiftLint/issues/2294) #### Bug Fixes diff --git a/Rules.md b/Rules.md index 0052e91c83..b6db560e18 100644 --- a/Rules.md +++ b/Rules.md @@ -6304,8 +6304,6 @@ Header comments should be consistent with project patterns. The SWIFTLINT_CURREN ### Examples -======= ->>>>>>> Split new rule up into two separate rules
Non Triggering Examples @@ -7628,23 +7626,9 @@ class TestViewController: UIViewController { // 3 lines } -<<<<<<< HEAD -```swift -realm?.objects(User.self).filter(NSPredicate(format: "email ==[c] %@", email)).first -``` - -```swift -if let pause = timeTracker.pauses.filter("beginDate < %@", beginDate).first { print(pause) } -``` - -
-
-Triggering Examples -======= enum TestEnum { // 5 lines } ->>>>>>> Fix issues after rebase // Stored Type Properties static let cellIdentifier: String = "AmazingCell" @@ -7856,6 +7840,14 @@ match(pattern: pattern).filter { $0.first == .identifier } collection.filter("stringCol = '3'").first ``` +```swift +realm?.objects(User.self).filter(NSPredicate(format: "email ==[c] %@", email)).first +``` + +```swift +if let pause = timeTracker.pauses.filter("beginDate < %@", beginDate).first { print(pause) } +``` +
Triggering Examples diff --git a/Source/SwiftLintFramework/Rules/RuleConfigurations/FileTypesOrderConfiguration.swift b/Source/SwiftLintFramework/Rules/RuleConfigurations/FileTypesOrderConfiguration.swift index a0b2c49f83..dbfc6d1c43 100644 --- a/Source/SwiftLintFramework/Rules/RuleConfigurations/FileTypesOrderConfiguration.swift +++ b/Source/SwiftLintFramework/Rules/RuleConfigurations/FileTypesOrderConfiguration.swift @@ -1,5 +1,3 @@ -import Foundation - enum FileType: String { case supportingType = "supporting_type" case mainType = "main_type" diff --git a/Source/SwiftLintFramework/Rules/RuleConfigurations/TypeContentsOrderConfiguration.swift b/Source/SwiftLintFramework/Rules/RuleConfigurations/TypeContentsOrderConfiguration.swift index 6a520772e7..f6749eb844 100644 --- a/Source/SwiftLintFramework/Rules/RuleConfigurations/TypeContentsOrderConfiguration.swift +++ b/Source/SwiftLintFramework/Rules/RuleConfigurations/TypeContentsOrderConfiguration.swift @@ -1,5 +1,3 @@ -import Foundation - enum TypeContent: String { case `case` = "case" case typeAlias = "type_alias" diff --git a/Source/SwiftLintFramework/Rules/Style/FileTypesOrderRuleExamples.swift b/Source/SwiftLintFramework/Rules/Style/FileTypesOrderRuleExamples.swift index b780b79b99..56b823ca15 100644 --- a/Source/SwiftLintFramework/Rules/Style/FileTypesOrderRuleExamples.swift +++ b/Source/SwiftLintFramework/Rules/Style/FileTypesOrderRuleExamples.swift @@ -1,5 +1,3 @@ -import Foundation - internal struct FileTypesOrderRuleExamples { static let defaultOrderParts = [ """ diff --git a/Source/SwiftLintFramework/Rules/Style/TypeContentsOrderRule.swift b/Source/SwiftLintFramework/Rules/Style/TypeContentsOrderRule.swift index a9b280f864..527797d14c 100644 --- a/Source/SwiftLintFramework/Rules/Style/TypeContentsOrderRule.swift +++ b/Source/SwiftLintFramework/Rules/Style/TypeContentsOrderRule.swift @@ -1,4 +1,3 @@ -import Foundation import SourceKittenFramework public struct TypeContentsOrderRule: ConfigurationProviderRule, OptInRule { diff --git a/Source/SwiftLintFramework/Rules/Style/TypeContentsOrderRuleExamples.swift b/Source/SwiftLintFramework/Rules/Style/TypeContentsOrderRuleExamples.swift index 5659315464..67b351814e 100644 --- a/Source/SwiftLintFramework/Rules/Style/TypeContentsOrderRuleExamples.swift +++ b/Source/SwiftLintFramework/Rules/Style/TypeContentsOrderRuleExamples.swift @@ -1,5 +1,3 @@ -import Foundation - // swiftlint:disable:next type_body_length internal struct TypeContentsOrderRuleExamples { static let defaultOrderParts = [