diff --git a/.swiftformat b/.swiftformat index 7d04363c2..c5d985349 100644 --- a/.swiftformat +++ b/.swiftformat @@ -1,7 +1,7 @@ # file options --symlinks ignore ---exclude Tests/XCTestManifests.swift,projects/tuist/features +--exclude Tests/XCTestManifests.swift,projects/tuist/features,Sources/TuistSupport/Vendored,projects/tuist/fixtures/app_with_docc/Targets/SlothCreator # format options @@ -17,7 +17,7 @@ --exponentgrouping disabled --extensionacl on-declarations --fractiongrouping disabled ---header ignore +--header strip --hexgrouping 4,8 --hexliteralcase uppercase --ifdef indent diff --git a/Sources/TuistSupport/Utils/SHA256Digest.swift b/Sources/TuistSupport/Utils/SHA256Digest.swift index fc1c2f623..2fc7bac32 100644 --- a/Sources/TuistSupport/Utils/SHA256Digest.swift +++ b/Sources/TuistSupport/Utils/SHA256Digest.swift @@ -1,10 +1,3 @@ -// -// SHA256Digest.swift -// TuistSupport -// -// Created by Maksym Prokopchuk on 23.11.19. -// - import CommonCrypto import Foundation diff --git a/Sources/TuistSupportTesting/Extensions/XCTestCase+Extras.swift b/Sources/TuistSupportTesting/Extensions/XCTestCase+Extras.swift index 57ffaf502..ece771c3e 100644 --- a/Sources/TuistSupportTesting/Extensions/XCTestCase+Extras.swift +++ b/Sources/TuistSupportTesting/Extensions/XCTestCase+Extras.swift @@ -316,39 +316,37 @@ extension XCTestCase { @discardableResult public func XCTAssertContainsElementOfType( _ collection: [Any], - _ element: T.Type, + _ type: T.Type, file: StaticString = #file, line: UInt = #line ) -> T? { guard let element = collection.first(where: { $0 is T }) else { - XCTFail("Didn't find an element of type \(String(describing: element))", file: file, line: line) + XCTFail("Didn't find an element of type \(String(describing: type))", file: file, line: line) return nil } return element as? T } - @discardableResult public func XCTAssertDoesntContainElementOfType( + public func XCTAssertDoesntContainElementOfType( _ collection: [Any], - _ element: T.Type, + _ type: T.Type, file: StaticString = #file, line: UInt = #line - ) -> T? { + ) { if let element = collection.first(where: { $0 is T }) { - XCTFail("Found an element of type \(String(describing: element))", file: file, line: line) - return nil + XCTFail("Found an element of type \(String(describing: type)): \(element)", file: file, line: line) } - return element as? T } @discardableResult public func XCTAssertContainsElementOfType( _ collection: [Any], - _ element: T.Type, + _ type: T.Type, after: U.Type, file: StaticString = #file, line: UInt = #line ) -> T? { guard let elementIndex = collection.lastIndex(where: { $0 is T }) else { - XCTFail("Didn't found an element of type \(String(describing: element))", file: file, line: line) + XCTFail("Didn't found an element of type \(String(describing: type))", file: file, line: line) return nil } guard let previousElementIndex = collection.firstIndex(where: { $0 is U }) else { @@ -357,7 +355,7 @@ extension XCTestCase { } XCTAssertTrue( elementIndex > previousElementIndex, - "Expected element of type \(String(describing: element)) to be after an element of type \(String(describing: after)) but it's not", + "Expected element of type \(String(describing: type)) to be after an element of type \(String(describing: after)) but it's not", file: file, line: line ) @@ -366,13 +364,13 @@ extension XCTestCase { @discardableResult public func XCTAssertContainsElementOfType( _ collection: [Any], - _ element: T.Type, + _ type: T.Type, before: U.Type, file: StaticString = #file, line: UInt = #line ) -> T? { guard let elementIndex = collection.firstIndex(where: { $0 is T }) else { - XCTFail("Didn't found an element of type \(String(describing: element))", file: file, line: line) + XCTFail("Didn't found an element of type \(String(describing: type))", file: file, line: line) return nil } guard let afterElementIndex = collection.lastIndex(where: { $0 is U }) else { @@ -381,7 +379,7 @@ extension XCTestCase { } XCTAssertTrue( elementIndex < afterElementIndex, - "Expected element of type \(String(describing: element)) to be before an element of type \(String(describing: before)) but it's not", + "Expected element of type \(String(describing: type)) to be before an element of type \(String(describing: before)) but it's not", file: file, line: line ) diff --git a/Sources/TuistSupportTesting/Utils/TestingLogHandler.swift b/Sources/TuistSupportTesting/Utils/TestingLogHandler.swift index 586dfc0e3..7673324d7 100644 --- a/Sources/TuistSupportTesting/Utils/TestingLogHandler.swift +++ b/Sources/TuistSupportTesting/Utils/TestingLogHandler.swift @@ -1,10 +1,3 @@ -// -// TestLoggingHandler.swift -// TuistSupportTesting -// -// Created by Atkinson, Oliver (Developer) on 20/02/2020. -// - import Foundation import TuistSupport diff --git a/projects/tuist/fixtures/app_with_docc/Targets/SlothCreator/Sources/SlothCreator.docc/Resources/code-files/01-creating-code-02-01.swift b/projects/tuist/fixtures/app_with_docc/Targets/SlothCreator/Sources/SlothCreator.docc/Resources/code-files/01-creating-code-02-01.swift index a7517e7c2..5bc20603f 100644 --- a/projects/tuist/fixtures/app_with_docc/Targets/SlothCreator/Sources/SlothCreator.docc/Resources/code-files/01-creating-code-02-01.swift +++ b/projects/tuist/fixtures/app_with_docc/Targets/SlothCreator/Sources/SlothCreator.docc/Resources/code-files/01-creating-code-02-01.swift @@ -1,6 +1,5 @@ /* See LICENSE folder for this sample’s licensing information. - Abstract: A view to customize a sloth. */ diff --git a/projects/tuist/fixtures/app_with_docc/Targets/SlothCreator/Sources/SlothCreator.docc/Resources/code-files/01-creating-code-02-02.swift b/projects/tuist/fixtures/app_with_docc/Targets/SlothCreator/Sources/SlothCreator.docc/Resources/code-files/01-creating-code-02-02.swift index 9a122d588..59bf1a052 100644 --- a/projects/tuist/fixtures/app_with_docc/Targets/SlothCreator/Sources/SlothCreator.docc/Resources/code-files/01-creating-code-02-02.swift +++ b/projects/tuist/fixtures/app_with_docc/Targets/SlothCreator/Sources/SlothCreator.docc/Resources/code-files/01-creating-code-02-02.swift @@ -1,6 +1,5 @@ /* See LICENSE folder for this sample’s licensing information. - Abstract: A view to customize a sloth. */ diff --git a/projects/tuist/fixtures/app_with_docc/Targets/SlothCreator/Sources/SlothCreator.docc/Resources/code-files/01-creating-code-02-03.swift b/projects/tuist/fixtures/app_with_docc/Targets/SlothCreator/Sources/SlothCreator.docc/Resources/code-files/01-creating-code-02-03.swift index 3223523ea..eb46ac09b 100644 --- a/projects/tuist/fixtures/app_with_docc/Targets/SlothCreator/Sources/SlothCreator.docc/Resources/code-files/01-creating-code-02-03.swift +++ b/projects/tuist/fixtures/app_with_docc/Targets/SlothCreator/Sources/SlothCreator.docc/Resources/code-files/01-creating-code-02-03.swift @@ -1,10 +1,3 @@ -/* - See LICENSE folder for this sample’s licensing information. - - Abstract: - A view to customize a sloth. - */ - import SlothCreator import SwiftUI diff --git a/projects/tuist/fixtures/app_with_docc/Targets/SlothCreator/Sources/SlothCreator.docc/Resources/code-files/01-creating-code-02-04.swift b/projects/tuist/fixtures/app_with_docc/Targets/SlothCreator/Sources/SlothCreator.docc/Resources/code-files/01-creating-code-02-04.swift index f4a1712b1..70ecbac44 100644 --- a/projects/tuist/fixtures/app_with_docc/Targets/SlothCreator/Sources/SlothCreator.docc/Resources/code-files/01-creating-code-02-04.swift +++ b/projects/tuist/fixtures/app_with_docc/Targets/SlothCreator/Sources/SlothCreator.docc/Resources/code-files/01-creating-code-02-04.swift @@ -1,6 +1,5 @@ /* See LICENSE folder for this sample’s licensing information. - Abstract: A view to customize a sloth. */ diff --git a/projects/tuist/fixtures/app_with_docc/Targets/SlothCreator/Sources/SlothCreator.docc/Resources/code-files/01-creating-code-02-05.swift b/projects/tuist/fixtures/app_with_docc/Targets/SlothCreator/Sources/SlothCreator.docc/Resources/code-files/01-creating-code-02-05.swift index b96fd7806..5dbfc8f5a 100644 --- a/projects/tuist/fixtures/app_with_docc/Targets/SlothCreator/Sources/SlothCreator.docc/Resources/code-files/01-creating-code-02-05.swift +++ b/projects/tuist/fixtures/app_with_docc/Targets/SlothCreator/Sources/SlothCreator.docc/Resources/code-files/01-creating-code-02-05.swift @@ -1,6 +1,5 @@ /* See LICENSE folder for this sample’s licensing information. - Abstract: A view to customize a sloth. */ diff --git a/projects/tuist/fixtures/app_with_docc/Targets/SlothCreator/Sources/SlothCreator.docc/Resources/code-files/01-creating-code-02-06.swift b/projects/tuist/fixtures/app_with_docc/Targets/SlothCreator/Sources/SlothCreator.docc/Resources/code-files/01-creating-code-02-06.swift index 4500426ce..821a0cfb0 100644 --- a/projects/tuist/fixtures/app_with_docc/Targets/SlothCreator/Sources/SlothCreator.docc/Resources/code-files/01-creating-code-02-06.swift +++ b/projects/tuist/fixtures/app_with_docc/Targets/SlothCreator/Sources/SlothCreator.docc/Resources/code-files/01-creating-code-02-06.swift @@ -1,6 +1,5 @@ /* See LICENSE folder for this sample’s licensing information. - Abstract: A view to customize a sloth. */ diff --git a/projects/tuist/fixtures/app_with_docc/Targets/SlothCreator/Sources/SlothCreator.docc/Resources/code-files/01-creating-code-02-07.swift b/projects/tuist/fixtures/app_with_docc/Targets/SlothCreator/Sources/SlothCreator.docc/Resources/code-files/01-creating-code-02-07.swift index dddb25de4..c9272ea5c 100644 --- a/projects/tuist/fixtures/app_with_docc/Targets/SlothCreator/Sources/SlothCreator.docc/Resources/code-files/01-creating-code-02-07.swift +++ b/projects/tuist/fixtures/app_with_docc/Targets/SlothCreator/Sources/SlothCreator.docc/Resources/code-files/01-creating-code-02-07.swift @@ -1,6 +1,5 @@ /* See LICENSE folder for this sample’s licensing information. - Abstract: A view to customize a sloth. */ diff --git a/projects/tuist/fixtures/app_with_docc/Targets/SlothCreator/Sources/SlothCreator.docc/Resources/code-files/01-creating-code-02-08.swift b/projects/tuist/fixtures/app_with_docc/Targets/SlothCreator/Sources/SlothCreator.docc/Resources/code-files/01-creating-code-02-08.swift index 279465b5b..d04d2c86c 100644 --- a/projects/tuist/fixtures/app_with_docc/Targets/SlothCreator/Sources/SlothCreator.docc/Resources/code-files/01-creating-code-02-08.swift +++ b/projects/tuist/fixtures/app_with_docc/Targets/SlothCreator/Sources/SlothCreator.docc/Resources/code-files/01-creating-code-02-08.swift @@ -1,6 +1,5 @@ /* See LICENSE folder for this sample’s licensing information. - Abstract: A view to customize a sloth. */ diff --git a/projects/tuist/fixtures/ios_app_with_extensions/MessageExtension/Sources/MessagesViewController.swift b/projects/tuist/fixtures/ios_app_with_extensions/MessageExtension/Sources/MessagesViewController.swift index e7292cfb6..82f7bdd32 100644 --- a/projects/tuist/fixtures/ios_app_with_extensions/MessageExtension/Sources/MessagesViewController.swift +++ b/projects/tuist/fixtures/ios_app_with_extensions/MessageExtension/Sources/MessagesViewController.swift @@ -1,10 +1,3 @@ -// -// MessagesViewController.swift -// MyMessageExtension -// -// Created by Kassem Wridan on 30/06/2020. -// - import Messages import UIKit diff --git a/projects/tuist/fixtures/ios_app_with_sdk/Playgrounds/App.playground/Contents.swift b/projects/tuist/fixtures/ios_app_with_sdk/Playgrounds/App.playground/Contents.swift index b5591b61b..fecc4ab44 100644 --- a/projects/tuist/fixtures/ios_app_with_sdk/Playgrounds/App.playground/Contents.swift +++ b/projects/tuist/fixtures/ios_app_with_sdk/Playgrounds/App.playground/Contents.swift @@ -1,3 +1 @@ -//: Playground - noun: a place where people can play - import Foundation diff --git a/projects/tuist/fixtures/ios_app_with_setup/Playgrounds/App.playground/Contents.swift b/projects/tuist/fixtures/ios_app_with_setup/Playgrounds/App.playground/Contents.swift index b5591b61b..fecc4ab44 100644 --- a/projects/tuist/fixtures/ios_app_with_setup/Playgrounds/App.playground/Contents.swift +++ b/projects/tuist/fixtures/ios_app_with_setup/Playgrounds/App.playground/Contents.swift @@ -1,3 +1 @@ -//: Playground - noun: a place where people can play - import Foundation diff --git a/projects/tuist/fixtures/ios_app_with_static_frameworks/Modules/A/Playgrounds/A.playground/Contents.swift b/projects/tuist/fixtures/ios_app_with_static_frameworks/Modules/A/Playgrounds/A.playground/Contents.swift index b5591b61b..fecc4ab44 100755 --- a/projects/tuist/fixtures/ios_app_with_static_frameworks/Modules/A/Playgrounds/A.playground/Contents.swift +++ b/projects/tuist/fixtures/ios_app_with_static_frameworks/Modules/A/Playgrounds/A.playground/Contents.swift @@ -1,3 +1 @@ -//: Playground - noun: a place where people can play - import Foundation diff --git a/projects/tuist/fixtures/ios_app_with_static_frameworks/Modules/B/Playgrounds/B.playground/Contents.swift b/projects/tuist/fixtures/ios_app_with_static_frameworks/Modules/B/Playgrounds/B.playground/Contents.swift index b5591b61b..fecc4ab44 100755 --- a/projects/tuist/fixtures/ios_app_with_static_frameworks/Modules/B/Playgrounds/B.playground/Contents.swift +++ b/projects/tuist/fixtures/ios_app_with_static_frameworks/Modules/B/Playgrounds/B.playground/Contents.swift @@ -1,3 +1 @@ -//: Playground - noun: a place where people can play - import Foundation diff --git a/projects/tuist/fixtures/ios_app_with_static_frameworks/Playgrounds/application_with_transistive_static_dependency.playground/Contents.swift b/projects/tuist/fixtures/ios_app_with_static_frameworks/Playgrounds/application_with_transistive_static_dependency.playground/Contents.swift index b5591b61b..fecc4ab44 100755 --- a/projects/tuist/fixtures/ios_app_with_static_frameworks/Playgrounds/application_with_transistive_static_dependency.playground/Contents.swift +++ b/projects/tuist/fixtures/ios_app_with_static_frameworks/Playgrounds/application_with_transistive_static_dependency.playground/Contents.swift @@ -1,3 +1 @@ -//: Playground - noun: a place where people can play - import Foundation diff --git a/projects/tuist/fixtures/ios_app_with_static_frameworks_with_resources/Modules/A/Playgrounds/A.playground/Contents.swift b/projects/tuist/fixtures/ios_app_with_static_frameworks_with_resources/Modules/A/Playgrounds/A.playground/Contents.swift index b5591b61b..fecc4ab44 100755 --- a/projects/tuist/fixtures/ios_app_with_static_frameworks_with_resources/Modules/A/Playgrounds/A.playground/Contents.swift +++ b/projects/tuist/fixtures/ios_app_with_static_frameworks_with_resources/Modules/A/Playgrounds/A.playground/Contents.swift @@ -1,3 +1 @@ -//: Playground - noun: a place where people can play - import Foundation diff --git a/projects/tuist/fixtures/ios_app_with_static_frameworks_with_resources/Modules/B/Playgrounds/B.playground/Contents.swift b/projects/tuist/fixtures/ios_app_with_static_frameworks_with_resources/Modules/B/Playgrounds/B.playground/Contents.swift index b5591b61b..fecc4ab44 100755 --- a/projects/tuist/fixtures/ios_app_with_static_frameworks_with_resources/Modules/B/Playgrounds/B.playground/Contents.swift +++ b/projects/tuist/fixtures/ios_app_with_static_frameworks_with_resources/Modules/B/Playgrounds/B.playground/Contents.swift @@ -1,3 +1 @@ -//: Playground - noun: a place where people can play - import Foundation diff --git a/projects/tuist/fixtures/ios_app_with_static_frameworks_with_resources/Playgrounds/application_with_transistive_static_dependency.playground/Contents.swift b/projects/tuist/fixtures/ios_app_with_static_frameworks_with_resources/Playgrounds/application_with_transistive_static_dependency.playground/Contents.swift index b5591b61b..fecc4ab44 100755 --- a/projects/tuist/fixtures/ios_app_with_static_frameworks_with_resources/Playgrounds/application_with_transistive_static_dependency.playground/Contents.swift +++ b/projects/tuist/fixtures/ios_app_with_static_frameworks_with_resources/Playgrounds/application_with_transistive_static_dependency.playground/Contents.swift @@ -1,3 +1 @@ -//: Playground - noun: a place where people can play - import Foundation diff --git a/projects/tuist/fixtures/ios_app_with_static_libraries/Modules/A/Playgrounds/A.playground/Contents.swift b/projects/tuist/fixtures/ios_app_with_static_libraries/Modules/A/Playgrounds/A.playground/Contents.swift index b5591b61b..fecc4ab44 100755 --- a/projects/tuist/fixtures/ios_app_with_static_libraries/Modules/A/Playgrounds/A.playground/Contents.swift +++ b/projects/tuist/fixtures/ios_app_with_static_libraries/Modules/A/Playgrounds/A.playground/Contents.swift @@ -1,3 +1 @@ -//: Playground - noun: a place where people can play - import Foundation diff --git a/projects/tuist/fixtures/ios_app_with_static_libraries/Modules/B/Playgrounds/B.playground/Contents.swift b/projects/tuist/fixtures/ios_app_with_static_libraries/Modules/B/Playgrounds/B.playground/Contents.swift index b5591b61b..fecc4ab44 100755 --- a/projects/tuist/fixtures/ios_app_with_static_libraries/Modules/B/Playgrounds/B.playground/Contents.swift +++ b/projects/tuist/fixtures/ios_app_with_static_libraries/Modules/B/Playgrounds/B.playground/Contents.swift @@ -1,3 +1 @@ -//: Playground - noun: a place where people can play - import Foundation diff --git a/projects/tuist/fixtures/ios_app_with_static_libraries/Playgrounds/application_with_transistive_static_dependency.playground/Contents.swift b/projects/tuist/fixtures/ios_app_with_static_libraries/Playgrounds/application_with_transistive_static_dependency.playground/Contents.swift index b5591b61b..fecc4ab44 100755 --- a/projects/tuist/fixtures/ios_app_with_static_libraries/Playgrounds/application_with_transistive_static_dependency.playground/Contents.swift +++ b/projects/tuist/fixtures/ios_app_with_static_libraries/Playgrounds/application_with_transistive_static_dependency.playground/Contents.swift @@ -1,3 +1 @@ -//: Playground - noun: a place where people can play - import Foundation diff --git a/projects/tuist/fixtures/ios_app_with_tests/App/UITests/AppUITest.swift b/projects/tuist/fixtures/ios_app_with_tests/App/UITests/AppUITest.swift index 635081295..e156a1764 100644 --- a/projects/tuist/fixtures/ios_app_with_tests/App/UITests/AppUITest.swift +++ b/projects/tuist/fixtures/ios_app_with_tests/App/UITests/AppUITest.swift @@ -1,5 +1,3 @@ -// Copyright © 2019 Sky. All rights reserved. - import XCTest class AppUITest: XCTestCase { diff --git a/projects/tuist/fixtures/ios_app_with_tests/Playgrounds/App.playground/Contents.swift b/projects/tuist/fixtures/ios_app_with_tests/Playgrounds/App.playground/Contents.swift index b5591b61b..fecc4ab44 100644 --- a/projects/tuist/fixtures/ios_app_with_tests/Playgrounds/App.playground/Contents.swift +++ b/projects/tuist/fixtures/ios_app_with_tests/Playgrounds/App.playground/Contents.swift @@ -1,3 +1 @@ -//: Playground - noun: a place where people can play - import Foundation diff --git a/projects/tuist/fixtures/tvos_app_with_uitest/App/UITests/AppUITest.swift b/projects/tuist/fixtures/tvos_app_with_uitest/App/UITests/AppUITest.swift index 635081295..e156a1764 100644 --- a/projects/tuist/fixtures/tvos_app_with_uitest/App/UITests/AppUITest.swift +++ b/projects/tuist/fixtures/tvos_app_with_uitest/App/UITests/AppUITest.swift @@ -1,5 +1,3 @@ -// Copyright © 2019 Sky. All rights reserved. - import XCTest class AppUITest: XCTestCase {