From 6127943b32d9f2fc950664dfeb6522df0a854477 Mon Sep 17 00:00:00 2001 From: Alexey Martemyanov Date: Fri, 30 Jun 2023 17:29:23 +0600 Subject: [PATCH 01/21] swiftlint plugin in bsk --- DuckDuckGo.xcodeproj/project.pbxproj | 104 +++++++++++------- .../xcshareddata/swiftpm/Package.resolved | 7 +- .../Tab/Model/UserContentUpdating.swift | 1 + .../DeviceAuthenticatorTests.swift | 8 +- UnitTests/Favicons/FaviconManagerTests.swift | 2 +- lint.sh | 55 --------- 6 files changed, 73 insertions(+), 104 deletions(-) delete mode 100755 lint.sh diff --git a/DuckDuckGo.xcodeproj/project.pbxproj b/DuckDuckGo.xcodeproj/project.pbxproj index eb041db6ff..eb461a9855 100644 --- a/DuckDuckGo.xcodeproj/project.pbxproj +++ b/DuckDuckGo.xcodeproj/project.pbxproj @@ -6486,13 +6486,13 @@ 378E2798296F6D1D00FCADA2 /* Validate PRODUCT_NAME */, 3706FA79293F65D500E42796 /* Check Embedded Config URLs */, 3706FA7A293F65D500E42796 /* Sources */, - 3706FCA5293F65D500E42796 /* Swift Lint */, 3706FCA6293F65D500E42796 /* Frameworks */, 3706FCB1293F65D500E42796 /* Resources */, ); buildRules = ( ); dependencies = ( + B69D061C2A4C0BC10032D14D /* PBXTargetDependency */, 4B5F14FE2A1529230060320F /* PBXTargetDependency */, ); name = "DuckDuckGo Privacy Browser App Store"; @@ -6528,6 +6528,7 @@ buildRules = ( ); dependencies = ( + B69D06182A4C0AD20032D14D /* PBXTargetDependency */, 37079A93294236F20031BB3C /* PBXTargetDependency */, ); name = "Unit Tests App Store"; @@ -6550,6 +6551,7 @@ buildRules = ( ); dependencies = ( + B69D061A2A4C0AD80032D14D /* PBXTargetDependency */, B6EC37F429B5DA94001ACE79 /* PBXTargetDependency */, 37079A95294236FA0031BB3C /* PBXTargetDependency */, ); @@ -6569,6 +6571,7 @@ buildRules = ( ); dependencies = ( + B69D06162A4C0ACD0032D14D /* PBXTargetDependency */, B6EC37F229B5DA8F001ACE79 /* PBXTargetDependency */, 4B1AD8A325FC27E200261379 /* PBXTargetDependency */, ); @@ -6763,7 +6766,6 @@ CBCCF59E299667B700C02DFE /* Assert Xcode version */, 3705272528992C8A000C06A2 /* Check Embedded Config URLs */, AA585D7A248FD31100E9A3E2 /* Sources */, - AA8EDF2824925E940071C2E8 /* Swift Lint */, AA585D7B248FD31100E9A3E2 /* Frameworks */, AA585D7C248FD31100E9A3E2 /* Resources */, 4B2D065D2A11D2AE00DE1F49 /* Embed Login Items */, @@ -6774,6 +6776,9 @@ buildRules = ( ); dependencies = ( + B69D060A2A4B19470032D14D /* PBXTargetDependency */, + B69D05F42A4AF1A30032D14D /* PBXTargetDependency */, + B69D05F22A4AF18F0032D14D /* PBXTargetDependency */, 4B5F14FC2A15291D0060320F /* PBXTargetDependency */, 4B2537642A11BE7600610219 /* PBXTargetDependency */, ); @@ -6813,6 +6818,7 @@ buildRules = ( ); dependencies = ( + B69D06142A4C0AC50032D14D /* PBXTargetDependency */, AA585D92248FD31400E9A3E2 /* PBXTargetDependency */, ); name = "Unit Tests"; @@ -7216,25 +7222,6 @@ shellPath = /bin/sh; shellScript = "if [ \"$CONFIGURATION\" == \"Release\" ]; then\n \"${SRCROOT}/scripts/update_embedded.sh\" -c\nfi\n"; }; - 3706FCA5293F65D500E42796 /* Swift Lint */ = { - isa = PBXShellScriptBuildPhase; - alwaysOutOfDate = 1; - buildActionMask = 2147483647; - files = ( - ); - inputFileListPaths = ( - ); - inputPaths = ( - ); - name = "Swift Lint"; - outputFileListPaths = ( - ); - outputPaths = ( - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/zsh; - shellScript = "./lint.sh\n"; - }; 378E2798296F6D1D00FCADA2 /* Validate PRODUCT_NAME */ = { isa = PBXShellScriptBuildPhase; alwaysOutOfDate = 1; @@ -7328,25 +7315,6 @@ shellPath = /bin/sh; shellScript = "echo \"ditto ${BUILT_PRODUCTS_DIR}/${SYSEX_BUNDLE_ID} $BUILT_PRODUCTS_DIR/${CONTENTS_FOLDER_PATH}/Library/SystemExtensions/${SYSEX_BUNDLE_ID}\"\n\nditto \"${BUILT_PRODUCTS_DIR}/${SYSEX_BUNDLE_ID}\" \"$BUILT_PRODUCTS_DIR/${CONTENTS_FOLDER_PATH}/Library/SystemExtensions/${SYSEX_BUNDLE_ID}\" || exit 1\n"; }; - AA8EDF2824925E940071C2E8 /* Swift Lint */ = { - isa = PBXShellScriptBuildPhase; - alwaysOutOfDate = 1; - buildActionMask = 2147483647; - files = ( - ); - inputFileListPaths = ( - ); - inputPaths = ( - ); - name = "Swift Lint"; - outputFileListPaths = ( - ); - outputPaths = ( - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/zsh; - shellScript = "./lint.sh\n"; - }; B6BD8F0A2A260E5900B6A41F /* ShellScript */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; @@ -9340,6 +9308,30 @@ target = AA585D7D248FD31100E9A3E2 /* DuckDuckGo Privacy Browser */; targetProxy = AA585D91248FD31400E9A3E2 /* PBXContainerItemProxy */; }; + B69D060A2A4B19470032D14D /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + productRef = B69D06092A4B19470032D14D /* SwiftLintPlugin */; + }; + B69D06142A4C0AC50032D14D /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + productRef = B69D06132A4C0AC50032D14D /* SwiftLintPlugin */; + }; + B69D06162A4C0ACD0032D14D /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + productRef = B69D06152A4C0ACD0032D14D /* SwiftLintPlugin */; + }; + B69D06182A4C0AD20032D14D /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + productRef = B69D06172A4C0AD20032D14D /* SwiftLintPlugin */; + }; + B69D061A2A4C0AD80032D14D /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + productRef = B69D06192A4C0AD80032D14D /* SwiftLintPlugin */; + }; + B69D061C2A4C0BC10032D14D /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + productRef = B69D061B2A4C0BC10032D14D /* SwiftLintPlugin */; + }; B6EC37F229B5DA8F001ACE79 /* PBXTargetDependency */ = { isa = PBXTargetDependency; target = B6EC37E729B5DA2A001ACE79 /* tests-server */; @@ -9785,6 +9777,10 @@ isa = XCBuildConfiguration; baseConfigurationReference = 378B58CD295ECA75002C0CC0 /* DuckDuckGo.xcconfig */; buildSettings = { + CODE_SIGN_IDENTITY = "Apple Development"; + CODE_SIGN_STYLE = Automatic; + DEVELOPMENT_TEAM = HKE973VLUW; + PROVISIONING_PROFILE_SPECIFIER = ""; }; name = Debug; }; @@ -10125,8 +10121,8 @@ isa = XCRemoteSwiftPackageReference; repositoryURL = "https://github.com/duckduckgo/BrowserServicesKit"; requirement = { - kind = exactVersion; - version = 62.0.7; + kind = revision; + revision = 2f78f34ec5f82478bf76427dc61cb886e40f5707; }; }; AA06B6B52672AF8100F541C5 /* XCRemoteSwiftPackageReference "Sparkle" */ = { @@ -10375,6 +10371,30 @@ package = AA06B6B52672AF8100F541C5 /* XCRemoteSwiftPackageReference "Sparkle" */; productName = Sparkle; }; + B69D06092A4B19470032D14D /* SwiftLintPlugin */ = { + isa = XCSwiftPackageProductDependency; + productName = "plugin:SwiftLintPlugin"; + }; + B69D06132A4C0AC50032D14D /* SwiftLintPlugin */ = { + isa = XCSwiftPackageProductDependency; + productName = "plugin:SwiftLintPlugin"; + }; + B69D06152A4C0ACD0032D14D /* SwiftLintPlugin */ = { + isa = XCSwiftPackageProductDependency; + productName = "plugin:SwiftLintPlugin"; + }; + B69D06172A4C0AD20032D14D /* SwiftLintPlugin */ = { + isa = XCSwiftPackageProductDependency; + productName = "plugin:SwiftLintPlugin"; + }; + B69D06192A4C0AD80032D14D /* SwiftLintPlugin */ = { + isa = XCSwiftPackageProductDependency; + productName = "plugin:SwiftLintPlugin"; + }; + B69D061B2A4C0BC10032D14D /* SwiftLintPlugin */ = { + isa = XCSwiftPackageProductDependency; + productName = "plugin:SwiftLintPlugin"; + }; B6AE39F229374AEC00C37AA4 /* OHHTTPStubs */ = { isa = XCSwiftPackageProductDependency; package = B6DA44152616C13800DD1EC2 /* XCRemoteSwiftPackageReference "OHHTTPStubs" */; diff --git a/DuckDuckGo.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved b/DuckDuckGo.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved index 11a1f50c15..c614b705c9 100644 --- a/DuckDuckGo.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved +++ b/DuckDuckGo.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved @@ -5,8 +5,7 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/duckduckgo/BrowserServicesKit", "state" : { - "revision" : "8794f9b1c0ff58fb8cc25ad6661bc62ae51924b8", - "version" : "62.0.7" + "revision" : "2f78f34ec5f82478bf76427dc61cb886e40f5707" } }, { @@ -14,8 +13,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/duckduckgo/content-scope-scripts", "state" : { - "revision" : "63f77323f119ac61fdb483f9c25f02d5d09f49ba", - "version" : "4.22.3" + "revision" : "1b5548805ed1d5af4bb6432ea23890797540fbdd", + "version" : "4.22.1" } }, { diff --git a/DuckDuckGo/Tab/Model/UserContentUpdating.swift b/DuckDuckGo/Tab/Model/UserContentUpdating.swift index 942e7d9acc..bf5ced5b1e 100644 --- a/DuckDuckGo/Tab/Model/UserContentUpdating.swift +++ b/DuckDuckGo/Tab/Model/UserContentUpdating.swift @@ -28,6 +28,7 @@ final class UserContentUpdating { struct NewContent: UserContentControllerNewContent { let rulesUpdate: ContentBlockerRulesManager.UpdateEvent let sourceProvider: ScriptSourceProviding + @MainActor var makeUserScripts: @MainActor (ScriptSourceProviding) -> UserScripts { return UserScripts.init(with:) } } diff --git a/UnitTests/DeviceAuthentication/DeviceAuthenticatorTests.swift b/UnitTests/DeviceAuthentication/DeviceAuthenticatorTests.swift index 2872a82875..1ad35c6e48 100644 --- a/UnitTests/DeviceAuthentication/DeviceAuthenticatorTests.swift +++ b/UnitTests/DeviceAuthentication/DeviceAuthenticatorTests.swift @@ -90,7 +90,7 @@ class DeviceAuthenticatorTests: XCTestCase { XCTAssertFalse(deviceAuthenticator.requiresAuthentication) } - func testWhenAutoLockIsEnabled_AndDeviceIsUnlocked_AndDeviceIsIdleForLongerThanTheThreshold_ThenDeviceBecomesLocked() async { + func testWhenAutoLockIsEnabled_AndDeviceIsUnlocked_AndDeviceIsIdleForLongerThanTheThreshold_ThenDeviceBecomesLocked() { let mockStatisticsStore = MockStatisticsStore() let idleStateProvider = MockIdleStateProvider(idleDuration: 60 * 20) // 20 minute idle duration, to be safe let authenticationService = MockDeviceAuthenticatorService.alwaysAuthenticate @@ -104,7 +104,11 @@ class DeviceAuthenticatorTests: XCTestCase { authenticationService: authenticationService, autofillPreferences: preferences) - _ = await deviceAuthenticator.authenticateUser(reason: .unlockLogins) + let unlockedExpectation = expectation(description: "Wait for unlockLogins") + deviceAuthenticator.authenticateUser(reason: .unlockLogins) { _ in + unlockedExpectation.fulfill() + } + waitForExpectations(timeout: 0.2) XCTAssertFalse(deviceAuthenticator.requiresAuthentication) diff --git a/UnitTests/Favicons/FaviconManagerTests.swift b/UnitTests/Favicons/FaviconManagerTests.swift index 7c92fd2637..5a8385400d 100644 --- a/UnitTests/Favicons/FaviconManagerTests.swift +++ b/UnitTests/Favicons/FaviconManagerTests.swift @@ -26,5 +26,5 @@ class FaviconManagerTests: XCTestCase { let faviconManager = FaviconManager(cacheType: .inMemory) XCTAssertNotNil(faviconManager.store as? FaviconNullStore) } - + } diff --git a/lint.sh b/lint.sh deleted file mode 100755 index 06f0cf3a97..0000000000 --- a/lint.sh +++ /dev/null @@ -1,55 +0,0 @@ -#!/bin/bash - -if [[ -n "$CI" ]]; then - echo "Skipping SwiftLint run in CI" - exit 0 -fi - -# Add brew into PATH -if [[ -f /opt/homebrew/bin/brew ]]; then - eval $(/opt/homebrew/bin/brew shellenv) -fi - -run_swiftlint_for_modified_files () { - TEST_FILES="" - CODE_FILES="" - - # collect staged and unstaged files and replace spaces in filenames with #001 - for FILE_NAME in $({ git diff --name-only & git diff --cached --name-only; } | tr ' ' '\001' | tr '\n ' ' ') - do - # collect .swift files separately for Unit Tests and Code Files - if [[ "${FILE_NAME##*.}" == "swift" ]]; then - # check if file exists (replacing back #001 with space) - if [ -f "`echo "${FILE_NAME}" | tr '\001' ' '`" ]; then - if [[ "$FILE_NAME" == *"Tests/"* ]]; then - TEST_FILES+=" \"${FILE_NAME}\"" - else - CODE_FILES+=" \"${FILE_NAME}\"" - fi - fi - fi - done - - if [ -n "${CODE_FILES}" ]; then - # replace back #001 with space and feed to swiftlint - echo "${CODE_FILES}" | tr '\001' ' ' | xargs swiftlint lint - fi - if [ -n "${TEST_FILES}" ]; then - echo "${TEST_FILES}" | tr '\001' ' ' | xargs swiftlint lint --config .swiftlint.tests.yml - fi -} - -if which swiftlint >/dev/null; then - if [ "$CONFIGURATION" = "Release" ]; then - swiftlint lint --strict - if [ $? -ne 0 ]; then - echo "error: SwiftLint validation failed." - exit 1 - fi - else - run_swiftlint_for_modified_files - fi -else - echo "error: SwiftLint not installed. Install using \`brew install swiftlint\`" - exit 1 -fi From 46c7e7da565e4a058b2e39e711b607b6456d1d20 Mon Sep 17 00:00:00 2001 From: Alexey Martemyanov Date: Wed, 6 Dec 2023 14:51:38 +0600 Subject: [PATCH 02/21] upd BSK --- DuckDuckGo.xcodeproj/project.pbxproj | 24 +------------------ .../xcschemes/DuckDuckGoAgent.xcscheme | 12 +++++----- .../Account/Sources/Account/AuthService.swift | 2 -- 3 files changed, 7 insertions(+), 31 deletions(-) diff --git a/DuckDuckGo.xcodeproj/project.pbxproj b/DuckDuckGo.xcodeproj/project.pbxproj index bcdb062043..bce12db599 100644 --- a/DuckDuckGo.xcodeproj/project.pbxproj +++ b/DuckDuckGo.xcodeproj/project.pbxproj @@ -8106,7 +8106,6 @@ 4B9579432AC7AE700062CA31 /* Assert Xcode version */, 4B9579442AC7AE700062CA31 /* Check Embedded Config URLs */, 4B9579452AC7AE700062CA31 /* Sources */, - 4B957BD32AC7AE700062CA31 /* Swift Lint */, 4B957BD42AC7AE700062CA31 /* Frameworks */, 4B957BEC2AC7AE700062CA31 /* Resources */, 4B957C322AC7AE700062CA31 /* Make /Applications symlink, remove app on Clean build */, @@ -8251,8 +8250,6 @@ ); dependencies = ( B69D060A2A4B19470032D14D /* PBXTargetDependency */, - B69D05F42A4AF1A30032D14D /* PBXTargetDependency */, - B69D05F22A4AF18F0032D14D /* PBXTargetDependency */, 4B5F14FC2A15291D0060320F /* PBXTargetDependency */, 31C6E9AD2B0C07BA0086DC30 /* PBXTargetDependency */, ); @@ -8965,25 +8962,6 @@ shellPath = /bin/sh; shellScript = "# We had issues where the Swift Package resources were not being added to the Agent Apps,\n# so we're manually coping them here.\n# It seems to be a known issue: https://forums.swift.org/t/swift-packages-resource-bundle-not-present-in-xcarchive-when-framework-using-said-package-is-archived/50084/2\ncp -RL \"${BUILT_PRODUCTS_DIR}\"/ContentScopeScripts_ContentScopeScripts.bundle \"${BUILT_PRODUCTS_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/\"\ncp -RL \"${BUILT_PRODUCTS_DIR}\"/DataBrokerProtection_DataBrokerProtection.bundle \"${BUILT_PRODUCTS_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/\"\n"; }; - AA8EDF2824925E940071C2E8 /* Swift Lint */ = { - isa = PBXShellScriptBuildPhase; - alwaysOutOfDate = 1; - buildActionMask = 2147483647; - files = ( - ); - inputFileListPaths = ( - ); - inputPaths = ( - ); - name = "Swift Lint"; - outputFileListPaths = ( - ); - outputPaths = ( - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/zsh; - shellScript = "if [ \"$ENABLE_PREVIEWS\" = \"YES\" ]; then exit 0; fi\n./lint.sh\n"; - }; B6BD8F0A2A260E5900B6A41F /* embed libswift_Concurrency.dylib */ = { isa = PBXShellScriptBuildPhase; alwaysOutOfDate = 1; @@ -12748,7 +12726,7 @@ repositoryURL = "https://github.com/duckduckgo/BrowserServicesKit"; requirement = { kind = revision; - revision = 2f78f34ec5f82478bf76427dc61cb886e40f5707; + revision = ff86a39a2acb9044cd2e12a9a209f867dca1dcc6; }; }; AA06B6B52672AF8100F541C5 /* XCRemoteSwiftPackageReference "Sparkle" */ = { diff --git a/DuckDuckGo.xcodeproj/xcshareddata/xcschemes/DuckDuckGoAgent.xcscheme b/DuckDuckGo.xcodeproj/xcshareddata/xcschemes/DuckDuckGoAgent.xcscheme index adc90361ec..83d1615164 100644 --- a/DuckDuckGo.xcodeproj/xcshareddata/xcschemes/DuckDuckGoAgent.xcscheme +++ b/DuckDuckGo.xcodeproj/xcshareddata/xcschemes/DuckDuckGoAgent.xcscheme @@ -15,8 +15,8 @@ @@ -44,8 +44,8 @@ @@ -61,8 +61,8 @@ diff --git a/LocalPackages/Account/Sources/Account/AuthService.swift b/LocalPackages/Account/Sources/Account/AuthService.swift index eaedf386e8..616451dec1 100644 --- a/LocalPackages/Account/Sources/Account/AuthService.swift +++ b/LocalPackages/Account/Sources/Account/AuthService.swift @@ -52,7 +52,6 @@ public struct AuthService { await executeAPICall(method: "GET", endpoint: "validate-token", headers: makeAuthorizationHeader(for: accessToken)) } - // swiftlint:disable nesting public struct ValidateTokenResponse: Decodable { public let account: Account @@ -72,7 +71,6 @@ public struct AuthService { let product: String } } - // swiftlint:enable nesting // MARK: - From c97e61817d628a697e1e14f68062d5931fe9277f Mon Sep 17 00:00:00 2001 From: Alexey Martemyanov Date: Wed, 6 Dec 2023 14:52:58 +0600 Subject: [PATCH 03/21] rollback Package.resolved --- .../xcshareddata/swiftpm/Package.resolved | 148 ++++++++++++++++++ 1 file changed, 148 insertions(+) create mode 100644 DuckDuckGo.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved diff --git a/DuckDuckGo.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved b/DuckDuckGo.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved new file mode 100644 index 0000000000..7d3b8b51a2 --- /dev/null +++ b/DuckDuckGo.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved @@ -0,0 +1,148 @@ +{ + "pins" : [ + { + "identity" : "bloom_cpp", + "kind" : "remoteSourceControl", + "location" : "https://github.com/duckduckgo/bloom_cpp.git", + "state" : { + "revision" : "8076199456290b61b4544bf2f4caf296759906a0", + "version" : "3.0.0" + } + }, + { + "identity" : "browserserviceskit", + "kind" : "remoteSourceControl", + "location" : "https://github.com/duckduckgo/BrowserServicesKit", + "state" : { + "revision" : "ff86a39a2acb9044cd2e12a9a209f867dca1dcc6" + } + }, + { + "identity" : "content-scope-scripts", + "kind" : "remoteSourceControl", + "location" : "https://github.com/duckduckgo/content-scope-scripts", + "state" : { + "revision" : "b7ad9843e70cede0c2ca9c4260d970f62cb28156", + "version" : "4.52.0" + } + }, + { + "identity" : "duckduckgo-autofill", + "kind" : "remoteSourceControl", + "location" : "https://github.com/duckduckgo/duckduckgo-autofill.git", + "state" : { + "revision" : "93677cc02cfe650ce7f417246afd0e8e972cd83e", + "version" : "10.0.0" + } + }, + { + "identity" : "grdb.swift", + "kind" : "remoteSourceControl", + "location" : "https://github.com/duckduckgo/GRDB.swift.git", + "state" : { + "revision" : "77d9a83191a74e319a5cfa27b0e3145d15607573", + "version" : "2.2.0" + } + }, + { + "identity" : "lottie-ios", + "kind" : "remoteSourceControl", + "location" : "https://github.com/duckduckgo/lottie-ios.git", + "state" : { + "revision" : "abf5510e261c85ffddd29de0bca9b72592ea2bdd", + "version" : "3.3.0" + } + }, + { + "identity" : "ohhttpstubs", + "kind" : "remoteSourceControl", + "location" : "https://github.com/AliSoftware/OHHTTPStubs.git", + "state" : { + "revision" : "12f19662426d0434d6c330c6974d53e2eb10ecd9", + "version" : "9.1.0" + } + }, + { + "identity" : "openssl-xcframework", + "kind" : "remoteSourceControl", + "location" : "https://github.com/duckduckgo/OpenSSL-XCFramework", + "state" : { + "revision" : "bb7bfc010ef4d2e7913c343663b167e2a984ac79", + "version" : "3.1.2000" + } + }, + { + "identity" : "privacy-dashboard", + "kind" : "remoteSourceControl", + "location" : "https://github.com/duckduckgo/privacy-dashboard", + "state" : { + "revision" : "daa9708223b4b4318fb6448ca44801dfabcddc6f", + "version" : "3.0.0" + } + }, + { + "identity" : "punycodeswift", + "kind" : "remoteSourceControl", + "location" : "https://github.com/gumob/PunycodeSwift.git", + "state" : { + "revision" : "4356ec54e073741449640d3d50a1fd24fd1e1b8b", + "version" : "2.1.0" + } + }, + { + "identity" : "sparkle", + "kind" : "remoteSourceControl", + "location" : "https://github.com/sparkle-project/Sparkle.git", + "state" : { + "revision" : "1f07f4096e52f19b5e7abaa697b7fc592b7ff57c", + "version" : "2.5.1" + } + }, + { + "identity" : "swift-argument-parser", + "kind" : "remoteSourceControl", + "location" : "https://github.com/apple/swift-argument-parser", + "state" : { + "revision" : "6b2aa2748a7881eebb9f84fb10c01293e15b52ca", + "version" : "0.5.0" + } + }, + { + "identity" : "swifter", + "kind" : "remoteSourceControl", + "location" : "https://github.com/httpswift/swifter.git", + "state" : { + "revision" : "9483a5d459b45c3ffd059f7b55f9638e268632fd", + "version" : "1.5.0" + } + }, + { + "identity" : "sync_crypto", + "kind" : "remoteSourceControl", + "location" : "https://github.com/duckduckgo/sync_crypto", + "state" : { + "revision" : "2ab6ab6f0f96b259c14c2de3fc948935fc16ac78", + "version" : "0.2.0" + } + }, + { + "identity" : "trackerradarkit", + "kind" : "remoteSourceControl", + "location" : "https://github.com/duckduckgo/TrackerRadarKit.git", + "state" : { + "revision" : "4684440d03304e7638a2c8086895367e90987463", + "version" : "1.2.1" + } + }, + { + "identity" : "wireguard-apple", + "kind" : "remoteSourceControl", + "location" : "https://github.com/duckduckgo/wireguard-apple", + "state" : { + "revision" : "2d8172c11478ab11b0f5ad49bdb4f93f4b3d5e0d", + "version" : "1.1.1" + } + } + ], + "version" : 2 +} From 44be67bb8248d231c6b2a6e28e3be4f1753ed91f Mon Sep 17 00:00:00 2001 From: Alexey Martemyanov Date: Wed, 6 Dec 2023 14:53:21 +0600 Subject: [PATCH 04/21] rm DuckDuckGo.xcodeproj/xcshareddata/xcschemes/DuckDuckGoAgent.xcscheme --- .../xcschemes/DuckDuckGoAgent.xcscheme | 77 ------------------- 1 file changed, 77 deletions(-) delete mode 100644 DuckDuckGo.xcodeproj/xcshareddata/xcschemes/DuckDuckGoAgent.xcscheme diff --git a/DuckDuckGo.xcodeproj/xcshareddata/xcschemes/DuckDuckGoAgent.xcscheme b/DuckDuckGo.xcodeproj/xcshareddata/xcschemes/DuckDuckGoAgent.xcscheme deleted file mode 100644 index 83d1615164..0000000000 --- a/DuckDuckGo.xcodeproj/xcshareddata/xcschemes/DuckDuckGoAgent.xcscheme +++ /dev/null @@ -1,77 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - From c6d848f28819015d59c5843a8b6a31b7c967070c Mon Sep 17 00:00:00 2001 From: Alexey Martemyanov Date: Wed, 6 Dec 2023 14:53:59 +0600 Subject: [PATCH 05/21] rollback UnitTests/DeviceAuthentication/DeviceAuthenticatorTests.swift --- .../DeviceAuthentication/DeviceAuthenticatorTests.swift | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/UnitTests/DeviceAuthentication/DeviceAuthenticatorTests.swift b/UnitTests/DeviceAuthentication/DeviceAuthenticatorTests.swift index d35d102b99..83871cf3a2 100644 --- a/UnitTests/DeviceAuthentication/DeviceAuthenticatorTests.swift +++ b/UnitTests/DeviceAuthentication/DeviceAuthenticatorTests.swift @@ -96,7 +96,7 @@ class DeviceAuthenticatorTests: XCTestCase { XCTAssertFalse(deviceAuthenticator.requiresAuthentication) } - func testWhenAutoLockIsEnabled_AndDeviceIsUnlocked_AndDeviceIsIdleForLongerThanTheThreshold_ThenDeviceBecomesLocked() { + func testWhenAutoLockIsEnabled_AndDeviceIsUnlocked_AndDeviceIsIdleForLongerThanTheThreshold_ThenDeviceBecomesLocked() async { let mockStatisticsStore = MockStatisticsStore() let idleStateProvider = MockIdleStateProvider(idleDuration: 60 * 20) // 20 minute idle duration, to be safe let authenticationService = MockDeviceAuthenticatorService.alwaysAuthenticate @@ -110,11 +110,7 @@ class DeviceAuthenticatorTests: XCTestCase { authenticationService: authenticationService, autofillPreferences: preferences) - let unlockedExpectation = expectation(description: "Wait for unlockLogins") - deviceAuthenticator.authenticateUser(reason: .unlockLogins) { _ in - unlockedExpectation.fulfill() - } - waitForExpectations(timeout: 0.2) + _ = await deviceAuthenticator.authenticateUser(reason: .unlockLogins) XCTAssertFalse(deviceAuthenticator.requiresAuthentication) From c056c42e4eccf3e56e384c4e1228e743d50bba34 Mon Sep 17 00:00:00 2001 From: Alexey Martemyanov Date: Wed, 6 Dec 2023 14:56:20 +0600 Subject: [PATCH 06/21] set swiftlint version to 0.54.0 --- .github/workflows/pr.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index 142c90ae96..ab576bf60d 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -16,7 +16,7 @@ jobs: steps: - uses: actions/checkout@v3 - name: SwiftLint - uses: docker://norionomura/swiftlint:0.53.0 + uses: docker://norionomura/swiftlint:0.54.0 with: args: swiftlint --reporter github-actions-logging --strict From df959528b625c9244e7bb009228050426774d6f9 Mon Sep 17 00:00:00 2001 From: Alexey Martemyanov Date: Wed, 6 Dec 2023 17:03:16 +0600 Subject: [PATCH 07/21] disable nesting rule --- .swiftlint.tests.yml | 3 +-- .swiftlint.yml | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/.swiftlint.tests.yml b/.swiftlint.tests.yml index 9f1ed37102..30eee9b4b2 100644 --- a/.swiftlint.tests.yml +++ b/.swiftlint.tests.yml @@ -16,6 +16,7 @@ disabled_rules: - implicit_getter - trailing_comma - blanket_disable_command + - nesting opt_in_rules: - file_header @@ -27,8 +28,6 @@ file_length: type_body_length: warning: 1000 error: 1500 -nesting: - type_level: 4 large_tuple: warning: 6 error: 10 diff --git a/.swiftlint.yml b/.swiftlint.yml index 8473c3c6af..d49ff0b852 100644 --- a/.swiftlint.yml +++ b/.swiftlint.yml @@ -9,6 +9,7 @@ disabled_rules: - implicit_getter - function_parameter_count - trailing_comma + - nesting opt_in_rules: - file_header @@ -41,8 +42,6 @@ file_length: type_body_length: warning: 500 error: 500 -nesting: - type_level: 2 large_tuple: warning: 4 error: 5 From c0458849b85538d1a09cb6d17f83a868b1aee505 Mon Sep 17 00:00:00 2001 From: Alexey Martemyanov Date: Wed, 6 Dec 2023 17:05:23 +0600 Subject: [PATCH 08/21] add SwiftLintPlugin to Local Packages --- DuckDuckGo.xcodeproj/project.pbxproj | 2 +- .../xcshareddata/swiftpm/Package.resolved | 2 +- LocalPackages/Account/Package.swift | 10 +++++++--- .../DataBrokerProtection/Package.swift | 7 +++++-- LocalPackages/LoginItems/Package.swift | 11 ++++++++--- .../NetworkProtectionMac/Package.swift | 12 +++++++++--- LocalPackages/PixelKit/Package.swift | 19 ++++++++++++++----- LocalPackages/Purchase/Package.swift | 12 +++++++++--- LocalPackages/Subscription/Package.swift | 11 ++++++++--- LocalPackages/SwiftUIExtensions/Package.swift | 11 ++++++++--- LocalPackages/SyncUI/Package.swift | 11 ++++++++--- .../SystemExtensionManager/Package.swift | 10 ++++++++-- LocalPackages/XPCHelper/Package.swift | 7 ++++--- 13 files changed, 90 insertions(+), 35 deletions(-) diff --git a/DuckDuckGo.xcodeproj/project.pbxproj b/DuckDuckGo.xcodeproj/project.pbxproj index bce12db599..a058beb66d 100644 --- a/DuckDuckGo.xcodeproj/project.pbxproj +++ b/DuckDuckGo.xcodeproj/project.pbxproj @@ -12726,7 +12726,7 @@ repositoryURL = "https://github.com/duckduckgo/BrowserServicesKit"; requirement = { kind = revision; - revision = ff86a39a2acb9044cd2e12a9a209f867dca1dcc6; + revision = c79353fa3c7c3745edb1e4f2c4372385099874b7; }; }; AA06B6B52672AF8100F541C5 /* XCRemoteSwiftPackageReference "Sparkle" */ = { diff --git a/DuckDuckGo.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved b/DuckDuckGo.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved index 7d3b8b51a2..ad691525b6 100644 --- a/DuckDuckGo.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved +++ b/DuckDuckGo.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved @@ -14,7 +14,7 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/duckduckgo/BrowserServicesKit", "state" : { - "revision" : "ff86a39a2acb9044cd2e12a9a209f867dca1dcc6" + "revision" : "c79353fa3c7c3745edb1e4f2c4372385099874b7" } }, { diff --git a/LocalPackages/Account/Package.swift b/LocalPackages/Account/Package.swift index 005c5f7465..772883179e 100644 --- a/LocalPackages/Account/Package.swift +++ b/LocalPackages/Account/Package.swift @@ -13,7 +13,7 @@ let package = Package( ], dependencies: [ .package(url: "https://github.com/duckduckgo/BrowserServicesKit", exact: "90.0.0"), - .package(path: "../Purchase") + .package(path: "../Purchase"), ], targets: [ .target( @@ -21,9 +21,13 @@ let package = Package( dependencies: [ .product(name: "BrowserServicesKit", package: "BrowserServicesKit"), .product(name: "Purchase", package: "Purchase") - ]), + ], + plugins: [.plugin(name: "SwiftLintPlugin", package: "BrowserServicesKit")] + ), .testTarget( name: "AccountTests", - dependencies: ["Account"]), + dependencies: ["Account"], + plugins: [.plugin(name: "SwiftLintPlugin", package: "BrowserServicesKit")] + ), ] ) diff --git a/LocalPackages/DataBrokerProtection/Package.swift b/LocalPackages/DataBrokerProtection/Package.swift index 90c6dafe14..4aaa5f2773 100644 --- a/LocalPackages/DataBrokerProtection/Package.swift +++ b/LocalPackages/DataBrokerProtection/Package.swift @@ -43,13 +43,16 @@ let package = Package( .product(name: "SwiftUIExtensions", package: "SwiftUIExtensions"), .byName(name: "XPCHelper") ], - resources: [.process("Resources")] + resources: [.process("Resources")], + plugins: [.plugin(name: "SwiftLintPlugin", package: "BrowserServicesKit")] ), .testTarget( name: "DataBrokerProtectionTests", dependencies: [ "DataBrokerProtection", "BrowserServicesKit" - ]) + ], + plugins: [.plugin(name: "SwiftLintPlugin", package: "BrowserServicesKit")] + ) ] ) diff --git a/LocalPackages/LoginItems/Package.swift b/LocalPackages/LoginItems/Package.swift index dc73fdf5d3..20f721ce12 100644 --- a/LocalPackages/LoginItems/Package.swift +++ b/LocalPackages/LoginItems/Package.swift @@ -9,12 +9,17 @@ let package = Package( products: [ .library( name: "LoginItems", - targets: ["LoginItems"]), + targets: ["LoginItems"] + ), + ], + dependencies: [ + .package(url: "https://github.com/duckduckgo/BrowserServicesKit", exact: "90.0.0"), ], - dependencies: [], targets: [ .target( name: "LoginItems", - dependencies: []), + dependencies: [], + plugins: [.plugin(name: "SwiftLintPlugin", package: "BrowserServicesKit")] + ), ] ) diff --git a/LocalPackages/NetworkProtectionMac/Package.swift b/LocalPackages/NetworkProtectionMac/Package.swift index 3a3b96da23..1b96431c49 100644 --- a/LocalPackages/NetworkProtectionMac/Package.swift +++ b/LocalPackages/NetworkProtectionMac/Package.swift @@ -42,7 +42,9 @@ let package = Package( dependencies: [ .product(name: "NetworkProtection", package: "BrowserServicesKit"), .product(name: "XPCHelper", package: "XPCHelper") - ]), + ], + plugins: [.plugin(name: "SwiftLintPlugin", package: "BrowserServicesKit")] + ), // MARK: - NetworkProtectionUI @@ -54,12 +56,16 @@ let package = Package( ], resources: [ .copy("Resources/Assets.xcassets") - ]), + ], + plugins: [.plugin(name: "SwiftLintPlugin", package: "BrowserServicesKit")] + ), .testTarget( name: "NetworkProtectionUITests", dependencies: [ "NetworkProtectionUI", .product(name: "NetworkProtectionTestUtils", package: "BrowserServicesKit") - ]) + ], + plugins: [.plugin(name: "SwiftLintPlugin", package: "BrowserServicesKit")] + ) ] ) diff --git a/LocalPackages/PixelKit/Package.swift b/LocalPackages/PixelKit/Package.swift index 4381539943..ab5dde862a 100644 --- a/LocalPackages/PixelKit/Package.swift +++ b/LocalPackages/PixelKit/Package.swift @@ -12,25 +12,34 @@ let package = Package( // Products define the executables and libraries a package produces, and make them visible to other packages. .library( name: "PixelKit", - targets: ["PixelKit"]), + targets: ["PixelKit"] + ), .library( name: "PixelKitTestingUtilities", - targets: ["PixelKitTestingUtilities"]) + targets: ["PixelKitTestingUtilities"] + ) ], dependencies: [ + .package(url: "https://github.com/duckduckgo/BrowserServicesKit", exact: "90.0.0"), ], targets: [ .target( name: "PixelKit", - dependencies: []), + dependencies: [], + plugins: [.plugin(name: "SwiftLintPlugin", package: "BrowserServicesKit")] + ), .testTarget( name: "PixelKitTests", dependencies: ["PixelKit", "PixelKitTestingUtilities"], swiftSettings: [ .define("DEBUG", .when(configuration: .debug)) - ]), + ], + plugins: [.plugin(name: "SwiftLintPlugin", package: "BrowserServicesKit")] + ), .target( name: "PixelKitTestingUtilities", - dependencies: ["PixelKit"]) + dependencies: ["PixelKit"], + plugins: [.plugin(name: "SwiftLintPlugin", package: "BrowserServicesKit")] + ) ] ) diff --git a/LocalPackages/Purchase/Package.swift b/LocalPackages/Purchase/Package.swift index 90f52affc5..945985ba14 100644 --- a/LocalPackages/Purchase/Package.swift +++ b/LocalPackages/Purchase/Package.swift @@ -9,16 +9,22 @@ let package = Package( products: [ .library( name: "Purchase", - targets: ["Purchase"]), + targets: ["Purchase"] + ), ], dependencies: [ + .package(url: "https://github.com/duckduckgo/BrowserServicesKit", exact: "90.0.0"), ], targets: [ .target( name: "Purchase", - dependencies: []), + dependencies: [], + plugins: [.plugin(name: "SwiftLintPlugin", package: "BrowserServicesKit")] + ), .testTarget( name: "PurchaseTests", - dependencies: ["Purchase"]), + dependencies: ["Purchase"], + plugins: [.plugin(name: "SwiftLintPlugin", package: "BrowserServicesKit")] + ), ] ) diff --git a/LocalPackages/Subscription/Package.swift b/LocalPackages/Subscription/Package.swift index 3ef881ba83..2c3b58b939 100644 --- a/LocalPackages/Subscription/Package.swift +++ b/LocalPackages/Subscription/Package.swift @@ -14,7 +14,8 @@ let package = Package( dependencies: [ .package(path: "../Account"), .package(path: "../Purchase"), - .package(path: "../SwiftUIExtensions") + .package(path: "../SwiftUIExtensions"), + .package(url: "https://github.com/duckduckgo/BrowserServicesKit", exact: "90.0.0"), ], targets: [ .target( @@ -26,9 +27,13 @@ let package = Package( ], resources: [ .process("Resources") - ]), + ], + plugins: [.plugin(name: "SwiftLintPlugin", package: "BrowserServicesKit")] + ), .testTarget( name: "SubscriptionTests", - dependencies: ["Subscription"]), + dependencies: ["Subscription"], + plugins: [.plugin(name: "SwiftLintPlugin", package: "BrowserServicesKit")] + ), ] ) diff --git a/LocalPackages/SwiftUIExtensions/Package.swift b/LocalPackages/SwiftUIExtensions/Package.swift index cb737eef4d..2a748e9b07 100644 --- a/LocalPackages/SwiftUIExtensions/Package.swift +++ b/LocalPackages/SwiftUIExtensions/Package.swift @@ -9,12 +9,17 @@ let package = Package( products: [ .library( name: "SwiftUIExtensions", - targets: ["SwiftUIExtensions"]), + targets: ["SwiftUIExtensions"] + ), + ], + dependencies: [ + .package(url: "https://github.com/duckduckgo/BrowserServicesKit", exact: "90.0.0"), ], - dependencies: [], targets: [ .target( name: "SwiftUIExtensions", - dependencies: []), + dependencies: [], + plugins: [.plugin(name: "SwiftLintPlugin", package: "BrowserServicesKit")] + ), ] ) diff --git a/LocalPackages/SyncUI/Package.swift b/LocalPackages/SyncUI/Package.swift index a933085181..9e594989be 100644 --- a/LocalPackages/SyncUI/Package.swift +++ b/LocalPackages/SyncUI/Package.swift @@ -12,16 +12,21 @@ let package = Package( targets: ["SyncUI"]), ], dependencies: [ - .package(path: "../SwiftUIExtensions") + .package(path: "../SwiftUIExtensions"), + .package(url: "https://github.com/duckduckgo/BrowserServicesKit", exact: "90.0.0"), ], targets: [ .target( name: "SyncUI", dependencies: [ .product(name: "SwiftUIExtensions", package: "SwiftUIExtensions") - ]), + ], + plugins: [.plugin(name: "SwiftLintPlugin", package: "BrowserServicesKit")] + ), .testTarget( name: "SyncUITests", - dependencies: ["SyncUI"]), + dependencies: ["SyncUI"], + plugins: [.plugin(name: "SwiftLintPlugin", package: "BrowserServicesKit")] + ), ] ) diff --git a/LocalPackages/SystemExtensionManager/Package.swift b/LocalPackages/SystemExtensionManager/Package.swift index cec75aa2e6..0520b2450d 100644 --- a/LocalPackages/SystemExtensionManager/Package.swift +++ b/LocalPackages/SystemExtensionManager/Package.swift @@ -12,12 +12,18 @@ let package = Package( // Products define the executables and libraries a package produces, making them visible to other packages. .library( name: "SystemExtensionManager", - targets: ["SystemExtensionManager"]), + targets: ["SystemExtensionManager"] + ), + ], + dependencies: [ + .package(url: "https://github.com/duckduckgo/BrowserServicesKit", exact: "90.0.0"), ], targets: [ // Targets are the basic building blocks of a package, defining a module or a test suite. // Targets can depend on other targets in this package and products from dependencies. .target( - name: "SystemExtensionManager") + name: "SystemExtensionManager", + plugins: [.plugin(name: "SwiftLintPlugin", package: "BrowserServicesKit")] + ) ] ) diff --git a/LocalPackages/XPCHelper/Package.swift b/LocalPackages/XPCHelper/Package.swift index 5eef7930ba..769640d83b 100644 --- a/LocalPackages/XPCHelper/Package.swift +++ b/LocalPackages/XPCHelper/Package.swift @@ -30,14 +30,15 @@ let package = Package( .library(name: "XPCHelper", targets: ["XPCHelper"]), ], dependencies: [ - // Dependencies declare other packages that this package depends on. - // .package(url: /* package url */, from: "1.0.0"), + .package(url: "https://github.com/duckduckgo/BrowserServicesKit", exact: "90.0.0"), ], targets: [ // Targets are the basic building blocks of a package. A target can define a module or a test suite. // Targets can depend on other targets in this package, and on products in packages this package depends on. .target( name: "XPCHelper", - dependencies: []) + dependencies: [], + plugins: [.plugin(name: "SwiftLintPlugin", package: "BrowserServicesKit")] + ) ] ) From e2300a996686db52a858f0c3e526e94fde3a0881 Mon Sep 17 00:00:00 2001 From: Alexey Martemyanov Date: Wed, 6 Dec 2023 17:17:56 +0600 Subject: [PATCH 09/21] fix linter issue --- DuckDuckGo/ContentBlocker/ClickToLoadUserScript.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DuckDuckGo/ContentBlocker/ClickToLoadUserScript.swift b/DuckDuckGo/ContentBlocker/ClickToLoadUserScript.swift index 472af05a9d..ef06cf4216 100644 --- a/DuckDuckGo/ContentBlocker/ClickToLoadUserScript.swift +++ b/DuckDuckGo/ContentBlocker/ClickToLoadUserScript.swift @@ -58,7 +58,7 @@ final class ClickToLoadUserScript: NSObject, UserScript, WKScriptMessageHandlerW } if message.name == "enableFacebook" { guard let delegate = delegate else { return } - delegate.clickToLoadUserScriptAllowFB(self) { (_) -> Void in + delegate.clickToLoadUserScriptAllowFB(self) { _ in guard let isLogin = message.body as? Bool else { replyHandler(nil, nil) return From f9ff5efa8a0751aecfe2c3e543f5a9997b1fd033 Mon Sep 17 00:00:00 2001 From: Alexey Martemyanov Date: Wed, 6 Dec 2023 19:26:28 +0600 Subject: [PATCH 10/21] update rules --- .swiftlint.tests.yml | 7 ++++--- .swiftlint.yml | 1 + 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/.swiftlint.tests.yml b/.swiftlint.tests.yml index 30eee9b4b2..8ec8efeb37 100644 --- a/.swiftlint.tests.yml +++ b/.swiftlint.tests.yml @@ -6,6 +6,7 @@ disabled_rules: - block_based_kvo - compiler_protocol_init - unused_setter_value + - unused_closure_parameter - line_length - type_name - force_cast @@ -17,6 +18,9 @@ disabled_rules: - trailing_comma - blanket_disable_command - nesting + - type_body_length + - opening_brace + - function_parameter_count opt_in_rules: - file_header @@ -25,9 +29,6 @@ opt_in_rules: file_length: warning: 1800 error: 2000 -type_body_length: - warning: 1000 - error: 1500 large_tuple: warning: 6 error: 10 diff --git a/.swiftlint.yml b/.swiftlint.yml index d49ff0b852..40ef1d7bf3 100644 --- a/.swiftlint.yml +++ b/.swiftlint.yml @@ -10,6 +10,7 @@ disabled_rules: - function_parameter_count - trailing_comma - nesting + - opening_brace opt_in_rules: - file_header From 6defa8d85999fbad89c7b276a2a0b8ed2b8f4278 Mon Sep 17 00:00:00 2001 From: Alexey Martemyanov Date: Wed, 6 Dec 2023 20:21:16 +0600 Subject: [PATCH 11/21] bump bsk; add targets to lint --- DuckDuckGo.xcodeproj/project.pbxproj | 111 ++++++++++++++++-- .../xcshareddata/swiftpm/Package.resolved | 6 +- 2 files changed, 105 insertions(+), 12 deletions(-) diff --git a/DuckDuckGo.xcodeproj/project.pbxproj b/DuckDuckGo.xcodeproj/project.pbxproj index a058beb66d..dc629c71f4 100644 --- a/DuckDuckGo.xcodeproj/project.pbxproj +++ b/DuckDuckGo.xcodeproj/project.pbxproj @@ -7989,6 +7989,7 @@ buildRules = ( ); dependencies = ( + B6080B9F2B20AF7B00B418EF /* PBXTargetDependency */, ); name = NetworkProtectionSystemExtension; packageProductDependencies = ( @@ -8014,6 +8015,7 @@ buildRules = ( ); dependencies = ( + B6080BA32B20AF8300B418EF /* PBXTargetDependency */, 7BEC18312AD5DA3300D30536 /* PBXTargetDependency */, ); name = DuckDuckGoVPN; @@ -8042,6 +8044,7 @@ buildRules = ( ); dependencies = ( + B6080BA52B20AF8800B418EF /* PBXTargetDependency */, ); name = DuckDuckGoVPNAppStore; packageProductDependencies = ( @@ -8066,6 +8069,7 @@ buildRules = ( ); dependencies = ( + B6080BA12B20AF7F00B418EF /* PBXTargetDependency */, 4B4BEC4A2A11B627001D9AC5 /* PBXTargetDependency */, ); name = DuckDuckGoNotifications; @@ -8086,6 +8090,7 @@ buildRules = ( ); dependencies = ( + B6080B9D2B20AF7700B418EF /* PBXTargetDependency */, 4B4D60532A0B29CB00BCD287 /* PBXTargetDependency */, ); name = NetworkProtectionAppExtension; @@ -8161,6 +8166,7 @@ buildRules = ( ); dependencies = ( + B6080B9B2B20AF6400B418EF /* PBXTargetDependency */, 7B4CE8E026F02108009134B1 /* PBXTargetDependency */, ); name = "UI Tests"; @@ -8179,6 +8185,7 @@ buildRules = ( ); dependencies = ( + B6080BA72B20AF8B00B418EF /* PBXTargetDependency */, 7B20D5C82ADFEC730053C42A /* PBXTargetDependency */, ); name = DuckDuckGoDBPTests; @@ -8196,11 +8203,12 @@ 9D9AE8B62AAA39A70026E7DC /* Sources */, 9D9AE8C62AAA39A70026E7DC /* Frameworks */, 9D9AE8C92AAA39A70026E7DC /* Resources */, - 7BB34F502AD98394005691AE /* ShellScript */, + 7BB34F502AD98394005691AE /* Copy Swift Package resources */, ); buildRules = ( ); dependencies = ( + B6080BA92B20AF8F00B418EF /* PBXTargetDependency */, ); name = DuckDuckGoDBPBackgroundAgent; packageProductDependencies = ( @@ -8223,6 +8231,7 @@ buildRules = ( ); dependencies = ( + B6080BAB2B20AF9200B418EF /* PBXTargetDependency */, ); name = DuckDuckGoDBPBackgroundAgentAppStore; packageProductDependencies = ( @@ -8249,7 +8258,7 @@ buildRules = ( ); dependencies = ( - B69D060A2A4B19470032D14D /* PBXTargetDependency */, + B692D0DF2B209FB7003F2548 /* PBXTargetDependency */, 4B5F14FC2A15291D0060320F /* PBXTargetDependency */, 31C6E9AD2B0C07BA0086DC30 /* PBXTargetDependency */, ); @@ -8909,6 +8918,7 @@ }; 7B31FD922AD126C40086AA24 /* Embed System Network Extension */ = { isa = PBXShellScriptBuildPhase; + alwaysOutOfDate = 1; buildActionMask = 2147483647; files = ( ); @@ -8944,7 +8954,7 @@ shellPath = /bin/sh; shellScript = "if [[ -z \"${SYSEX_BUNDLE_ID}\" ]]; then\n echo \"Required build settings are not defined, please check xcconfig files\"\n exit 1\nfi\n\n\necho \"ditto ${BUILT_PRODUCTS_DIR}/${SYSEX_BUNDLE_ID}.systemextension $BUILT_PRODUCTS_DIR/${CONTENTS_FOLDER_PATH}/Library/SystemExtensions/${SYSEX_BUNDLE_ID}.systemextension\"\n\nditto \"${BUILT_PRODUCTS_DIR}/${SYSEX_BUNDLE_ID}.systemextension\" \"$BUILT_PRODUCTS_DIR/${CONTENTS_FOLDER_PATH}/Library/SystemExtensions/${SYSEX_BUNDLE_ID}.systemextension\" || exit 1\n"; }; - 7BB34F502AD98394005691AE /* ShellScript */ = { + 7BB34F502AD98394005691AE /* Copy Swift Package resources */ = { isa = PBXShellScriptBuildPhase; alwaysOutOfDate = 1; buildActionMask = 2147483647; @@ -8954,6 +8964,7 @@ ); inputPaths = ( ); + name = "Copy Swift Package resources"; outputFileListPaths = ( ); outputPaths = ( @@ -8979,7 +8990,7 @@ ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "FRAMEWORKS_DIR=\"${BUILT_PRODUCTS_DIR}/${FRAMEWORKS_FOLDER_PATH}\"\nDYLIB_TARGET_PATH=\"${FRAMEWORKS_DIR}/libswift_Concurrency.dylib\"\n\nif [ ! -e \"${DYLIB_TARGET_PATH}\" ]; then\n\n DYLIB_PATH=$(find \"${TOOLCHAIN_DIR}/usr/lib\" -path \"*/${HOST_PLATFORM}/libswift_Concurrency.dylib\")\n echo \"copy ${DYLIB_PATH} to ${DYLIB_TARGET_PATH}\"\n\n mkdir -p \"${FRAMEWORKS_DIR}\"\n cp \"${DYLIB_PATH}\" \"${DYLIB_TARGET_PATH}\" || exit 1\n\nelse\n echo \"${DYLIB_TARGET_PATH} exists\"\nfi\n"; + shellScript = "FRAMEWORKS_DIR=\"${BUILT_PRODUCTS_DIR}/${FRAMEWORKS_FOLDER_PATH}\"\nDYLIB_TARGET_PATH=\"${FRAMEWORKS_DIR}/libswift_Concurrency.dylib\"\n\nif [ ! -e \"${DYLIB_TARGET_PATH}\" ]; then\n\n DYLIB_PATH=$(find \"${TOOLCHAIN_DIR}/usr/lib\" -path \"*/${HOST_PLATFORM}/libswift_Concurrency.dylib\")\n echo \"copy ${DYLIB_PATH} to ${DYLIB_TARGET_PATH}\"\n\n mkdir -p \"${FRAMEWORKS_DIR}\"\n cp \"${DYLIB_PATH}\" \"${DYLIB_TARGET_PATH}\" || exit 1\n\nelse\n echo \"${DYLIB_TARGET_PATH} exists 👌\"\nfi\n"; }; B6F2C8722A7A4C7D000498CF /* Make /Applications symlink, remove app on Clean build */ = { isa = PBXShellScriptBuildPhase; @@ -8998,7 +9009,7 @@ ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "if [[ \"${CONFIGURATION}\" != \"Debug\" ]]; then\n # run only for Debug builds\n exit 0\nfi\n\n# if Xcode created real Applications directory inside BUILT_PRODUCTS_DIR \nif [[ ! -L ${BUILT_PRODUCTS_DIR}/Applications ]]; then\n # we only get here on clean build, remove an existing app in /Applications/DEBUG on clean build\n echo \"rm -rf /${INSTALL_PATH}/${PRODUCT_NAME}.app\"\n rm -rf \"/${INSTALL_PATH}/${PRODUCT_NAME}.app\"\n\n # create /Applications/DEBUG dir\n echo \"mkdir -p /${INSTALL_PATH}\"\n mkdir -p \"/${INSTALL_PATH}\"\n\n # move the app bundle to /Applications/DEBUG\n echo \"mv ${DSTROOT}/${INSTALL_PATH}/${PRODUCT_NAME}.app /${INSTALL_PATH}/${PRODUCT_NAME}.app\"\n mv \"${DSTROOT}/${INSTALL_PATH}/${PRODUCT_NAME}.app\" \"/${INSTALL_PATH}/${PRODUCT_NAME}.app\"\n\n # rm ${BUILT_PRODUCTS_DIR}/Applications directory created by Xcode\n echo \"rm -rf ${BUILT_PRODUCTS_DIR}/Applications\" \n rm -rf \"${BUILT_PRODUCTS_DIR}/Applications\"\n # create ${BUILT_PRODUCTS_DIR}/Applications symlink to /Applications\n echo \"ln -s /Applications ${BUILT_PRODUCTS_DIR}/Applications\"\n ln -s /Applications \"${BUILT_PRODUCTS_DIR}/Applications\"\nfi\n"; + shellScript = "if [[ \"${CONFIGURATION}\" != \"Debug\" ]]; then\n # run only for Debug builds\n exit 0\nfi\n\n# if Xcode created real Applications directory inside BUILT_PRODUCTS_DIR \nif [[ ! -L ${BUILT_PRODUCTS_DIR}/Applications ]]; then\n # we only get here on clean build, remove an existing app in /Applications/DEBUG on clean build\n echo \"rm -rf /${INSTALL_PATH}/${PRODUCT_NAME}.app\"\n rm -rf \"/${INSTALL_PATH}/${PRODUCT_NAME}.app\"\n\n # create /Applications/DEBUG dir\n echo \"mkdir -p /${INSTALL_PATH}\"\n mkdir -p \"/${INSTALL_PATH}\"\n\n # move the app bundle to /Applications/DEBUG\n echo \"mv ${DSTROOT}/${INSTALL_PATH}/${PRODUCT_NAME}.app /${INSTALL_PATH}/${PRODUCT_NAME}.app\"\n mv \"${DSTROOT}/${INSTALL_PATH}/${PRODUCT_NAME}.app\" \"/${INSTALL_PATH}/${PRODUCT_NAME}.app\"\n\n # rm ${BUILT_PRODUCTS_DIR}/Applications directory created by Xcode\n echo \"rm -rf ${BUILT_PRODUCTS_DIR}/Applications\" \n rm -rf \"${BUILT_PRODUCTS_DIR}/Applications\"\n # create ${BUILT_PRODUCTS_DIR}/Applications symlink to /Applications\n echo \"ln -s /Applications ${BUILT_PRODUCTS_DIR}/Applications\"\n ln -s /Applications \"${BUILT_PRODUCTS_DIR}/Applications\"\nelse\n echo \"/Applications symlink 👌\"\nfi\n"; }; CBCCF59E299667B700C02DFE /* Assert Xcode version */ = { isa = PBXShellScriptBuildPhase; @@ -11849,9 +11860,45 @@ target = AA585D7D248FD31100E9A3E2 /* DuckDuckGo Privacy Browser */; targetProxy = AA585D91248FD31400E9A3E2 /* PBXContainerItemProxy */; }; - B69D060A2A4B19470032D14D /* PBXTargetDependency */ = { + B6080B9B2B20AF6400B418EF /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + productRef = B6080B9A2B20AF6400B418EF /* SwiftLintPlugin */; + }; + B6080B9D2B20AF7700B418EF /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + productRef = B6080B9C2B20AF7700B418EF /* SwiftLintPlugin */; + }; + B6080B9F2B20AF7B00B418EF /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + productRef = B6080B9E2B20AF7B00B418EF /* SwiftLintPlugin */; + }; + B6080BA12B20AF7F00B418EF /* PBXTargetDependency */ = { isa = PBXTargetDependency; - productRef = B69D06092A4B19470032D14D /* SwiftLintPlugin */; + productRef = B6080BA02B20AF7F00B418EF /* SwiftLintPlugin */; + }; + B6080BA32B20AF8300B418EF /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + productRef = B6080BA22B20AF8300B418EF /* SwiftLintPlugin */; + }; + B6080BA52B20AF8800B418EF /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + productRef = B6080BA42B20AF8800B418EF /* SwiftLintPlugin */; + }; + B6080BA72B20AF8B00B418EF /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + productRef = B6080BA62B20AF8B00B418EF /* SwiftLintPlugin */; + }; + B6080BA92B20AF8F00B418EF /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + productRef = B6080BA82B20AF8F00B418EF /* SwiftLintPlugin */; + }; + B6080BAB2B20AF9200B418EF /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + productRef = B6080BAA2B20AF9200B418EF /* SwiftLintPlugin */; + }; + B692D0DF2B209FB7003F2548 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + productRef = B692D0DE2B209FB7003F2548 /* SwiftLintPlugin */; }; B69D06142A4C0AC50032D14D /* PBXTargetDependency */ = { isa = PBXTargetDependency; @@ -12726,7 +12773,7 @@ repositoryURL = "https://github.com/duckduckgo/BrowserServicesKit"; requirement = { kind = revision; - revision = c79353fa3c7c3745edb1e4f2c4372385099874b7; + revision = 93b4daf47cddbbe5eb3e072931ed99b8e28ae39c; }; }; AA06B6B52672AF8100F541C5 /* XCRemoteSwiftPackageReference "Sparkle" */ = { @@ -13181,8 +13228,54 @@ package = AA06B6B52672AF8100F541C5 /* XCRemoteSwiftPackageReference "Sparkle" */; productName = Sparkle; }; - B69D06092A4B19470032D14D /* SwiftLintPlugin */ = { + B6080B9A2B20AF6400B418EF /* SwiftLintPlugin */ = { + isa = XCSwiftPackageProductDependency; + package = 9807F643278CA16F00E1547B /* XCRemoteSwiftPackageReference "BrowserServicesKit" */; + productName = "plugin:SwiftLintPlugin"; + }; + B6080B9C2B20AF7700B418EF /* SwiftLintPlugin */ = { isa = XCSwiftPackageProductDependency; + package = 9807F643278CA16F00E1547B /* XCRemoteSwiftPackageReference "BrowserServicesKit" */; + productName = "plugin:SwiftLintPlugin"; + }; + B6080B9E2B20AF7B00B418EF /* SwiftLintPlugin */ = { + isa = XCSwiftPackageProductDependency; + package = 9807F643278CA16F00E1547B /* XCRemoteSwiftPackageReference "BrowserServicesKit" */; + productName = "plugin:SwiftLintPlugin"; + }; + B6080BA02B20AF7F00B418EF /* SwiftLintPlugin */ = { + isa = XCSwiftPackageProductDependency; + package = 9807F643278CA16F00E1547B /* XCRemoteSwiftPackageReference "BrowserServicesKit" */; + productName = "plugin:SwiftLintPlugin"; + }; + B6080BA22B20AF8300B418EF /* SwiftLintPlugin */ = { + isa = XCSwiftPackageProductDependency; + package = 9807F643278CA16F00E1547B /* XCRemoteSwiftPackageReference "BrowserServicesKit" */; + productName = "plugin:SwiftLintPlugin"; + }; + B6080BA42B20AF8800B418EF /* SwiftLintPlugin */ = { + isa = XCSwiftPackageProductDependency; + package = 9807F643278CA16F00E1547B /* XCRemoteSwiftPackageReference "BrowserServicesKit" */; + productName = "plugin:SwiftLintPlugin"; + }; + B6080BA62B20AF8B00B418EF /* SwiftLintPlugin */ = { + isa = XCSwiftPackageProductDependency; + package = 9807F643278CA16F00E1547B /* XCRemoteSwiftPackageReference "BrowserServicesKit" */; + productName = "plugin:SwiftLintPlugin"; + }; + B6080BA82B20AF8F00B418EF /* SwiftLintPlugin */ = { + isa = XCSwiftPackageProductDependency; + package = 9807F643278CA16F00E1547B /* XCRemoteSwiftPackageReference "BrowserServicesKit" */; + productName = "plugin:SwiftLintPlugin"; + }; + B6080BAA2B20AF9200B418EF /* SwiftLintPlugin */ = { + isa = XCSwiftPackageProductDependency; + package = 9807F643278CA16F00E1547B /* XCRemoteSwiftPackageReference "BrowserServicesKit" */; + productName = "plugin:SwiftLintPlugin"; + }; + B692D0DE2B209FB7003F2548 /* SwiftLintPlugin */ = { + isa = XCSwiftPackageProductDependency; + package = 9807F643278CA16F00E1547B /* XCRemoteSwiftPackageReference "BrowserServicesKit" */; productName = "plugin:SwiftLintPlugin"; }; B69D06132A4C0AC50032D14D /* SwiftLintPlugin */ = { diff --git a/DuckDuckGo.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved b/DuckDuckGo.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved index ad691525b6..f988e37bd9 100644 --- a/DuckDuckGo.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved +++ b/DuckDuckGo.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved @@ -14,7 +14,7 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/duckduckgo/BrowserServicesKit", "state" : { - "revision" : "c79353fa3c7c3745edb1e4f2c4372385099874b7" + "revision" : "93b4daf47cddbbe5eb3e072931ed99b8e28ae39c" } }, { @@ -76,8 +76,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/duckduckgo/privacy-dashboard", "state" : { - "revision" : "daa9708223b4b4318fb6448ca44801dfabcddc6f", - "version" : "3.0.0" + "revision" : "38336a574e13090764ba09a6b877d15ee514e371", + "version" : "3.1.1" } }, { From 3d6d28dd895edd757d61a688b22b764134ce8efc Mon Sep 17 00:00:00 2001 From: Alexey Martemyanov Date: Thu, 7 Dec 2023 13:34:56 +0600 Subject: [PATCH 12/21] bump BSK; add DEBUG build condition for local packages built in DEBUG --- DuckDuckGo.xcodeproj/project.pbxproj | 2 +- .../xcshareddata/swiftpm/Package.resolved | 10 +++++----- LocalPackages/Account/Package.swift | 3 +++ LocalPackages/DataBrokerProtection/Package.swift | 3 +++ LocalPackages/LoginItems/Package.swift | 3 +++ LocalPackages/NetworkProtectionMac/Package.swift | 6 ++++++ LocalPackages/PixelKit/Package.swift | 3 +++ LocalPackages/Purchase/Package.swift | 3 +++ LocalPackages/Subscription/Package.swift | 3 +++ LocalPackages/SwiftUIExtensions/Package.swift | 3 +++ LocalPackages/SyncUI/Package.swift | 3 +++ LocalPackages/SystemExtensionManager/Package.swift | 3 +++ LocalPackages/XPCHelper/Package.swift | 3 +++ 13 files changed, 42 insertions(+), 6 deletions(-) diff --git a/DuckDuckGo.xcodeproj/project.pbxproj b/DuckDuckGo.xcodeproj/project.pbxproj index dc629c71f4..a794b66ed8 100644 --- a/DuckDuckGo.xcodeproj/project.pbxproj +++ b/DuckDuckGo.xcodeproj/project.pbxproj @@ -12773,7 +12773,7 @@ repositoryURL = "https://github.com/duckduckgo/BrowserServicesKit"; requirement = { kind = revision; - revision = 93b4daf47cddbbe5eb3e072931ed99b8e28ae39c; + revision = fb25ff6a2945448213b8422b6a7416ee48802278; }; }; AA06B6B52672AF8100F541C5 /* XCRemoteSwiftPackageReference "Sparkle" */ = { diff --git a/DuckDuckGo.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved b/DuckDuckGo.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved index f988e37bd9..eadf5d98e0 100644 --- a/DuckDuckGo.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved +++ b/DuckDuckGo.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved @@ -14,7 +14,7 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/duckduckgo/BrowserServicesKit", "state" : { - "revision" : "93b4daf47cddbbe5eb3e072931ed99b8e28ae39c" + "revision" : "fb25ff6a2945448213b8422b6a7416ee48802278" } }, { @@ -103,8 +103,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/apple/swift-argument-parser", "state" : { - "revision" : "6b2aa2748a7881eebb9f84fb10c01293e15b52ca", - "version" : "0.5.0" + "revision" : "c8ed701b513cf5177118a175d85fbbbcd707ab41", + "version" : "1.3.0" } }, { @@ -130,8 +130,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/duckduckgo/TrackerRadarKit.git", "state" : { - "revision" : "4684440d03304e7638a2c8086895367e90987463", - "version" : "1.2.1" + "revision" : "a6b7ba151d9dc6684484f3785293875ec01cc1ff", + "version" : "1.2.2" } }, { diff --git a/LocalPackages/Account/Package.swift b/LocalPackages/Account/Package.swift index 8760365b99..5a4455aded 100644 --- a/LocalPackages/Account/Package.swift +++ b/LocalPackages/Account/Package.swift @@ -22,6 +22,9 @@ let package = Package( .product(name: "BrowserServicesKit", package: "BrowserServicesKit"), .product(name: "Purchase", package: "Purchase") ], + swiftSettings: [ + .define("DEBUG", .when(configuration: .debug)) + ], plugins: [.plugin(name: "SwiftLintPlugin", package: "BrowserServicesKit")] ), .testTarget( diff --git a/LocalPackages/DataBrokerProtection/Package.swift b/LocalPackages/DataBrokerProtection/Package.swift index 41d3b3c6a8..e2e4505a6c 100644 --- a/LocalPackages/DataBrokerProtection/Package.swift +++ b/LocalPackages/DataBrokerProtection/Package.swift @@ -44,6 +44,9 @@ let package = Package( .byName(name: "XPCHelper") ], resources: [.process("Resources")], + swiftSettings: [ + .define("DEBUG", .when(configuration: .debug)) + ], plugins: [.plugin(name: "SwiftLintPlugin", package: "BrowserServicesKit")] ), .testTarget( diff --git a/LocalPackages/LoginItems/Package.swift b/LocalPackages/LoginItems/Package.swift index 20f721ce12..9aee9b8d7a 100644 --- a/LocalPackages/LoginItems/Package.swift +++ b/LocalPackages/LoginItems/Package.swift @@ -19,6 +19,9 @@ let package = Package( .target( name: "LoginItems", dependencies: [], + swiftSettings: [ + .define("DEBUG", .when(configuration: .debug)) + ], plugins: [.plugin(name: "SwiftLintPlugin", package: "BrowserServicesKit")] ), ] diff --git a/LocalPackages/NetworkProtectionMac/Package.swift b/LocalPackages/NetworkProtectionMac/Package.swift index 9f26e3a3f0..ef22dcf3d7 100644 --- a/LocalPackages/NetworkProtectionMac/Package.swift +++ b/LocalPackages/NetworkProtectionMac/Package.swift @@ -43,6 +43,9 @@ let package = Package( .product(name: "NetworkProtection", package: "BrowserServicesKit"), .product(name: "XPCHelper", package: "XPCHelper") ], + swiftSettings: [ + .define("DEBUG", .when(configuration: .debug)) + ], plugins: [.plugin(name: "SwiftLintPlugin", package: "BrowserServicesKit")] ), @@ -57,6 +60,9 @@ let package = Package( resources: [ .copy("Resources/Assets.xcassets") ], + swiftSettings: [ + .define("DEBUG", .when(configuration: .debug)) + ], plugins: [.plugin(name: "SwiftLintPlugin", package: "BrowserServicesKit")] ), .testTarget( diff --git a/LocalPackages/PixelKit/Package.swift b/LocalPackages/PixelKit/Package.swift index ab5dde862a..76dcd70869 100644 --- a/LocalPackages/PixelKit/Package.swift +++ b/LocalPackages/PixelKit/Package.swift @@ -26,6 +26,9 @@ let package = Package( .target( name: "PixelKit", dependencies: [], + swiftSettings: [ + .define("DEBUG", .when(configuration: .debug)) + ], plugins: [.plugin(name: "SwiftLintPlugin", package: "BrowserServicesKit")] ), .testTarget( diff --git a/LocalPackages/Purchase/Package.swift b/LocalPackages/Purchase/Package.swift index 945985ba14..831317aeae 100644 --- a/LocalPackages/Purchase/Package.swift +++ b/LocalPackages/Purchase/Package.swift @@ -19,6 +19,9 @@ let package = Package( .target( name: "Purchase", dependencies: [], + swiftSettings: [ + .define("DEBUG", .when(configuration: .debug)) + ], plugins: [.plugin(name: "SwiftLintPlugin", package: "BrowserServicesKit")] ), .testTarget( diff --git a/LocalPackages/Subscription/Package.swift b/LocalPackages/Subscription/Package.swift index 2c3b58b939..aabd98c5de 100644 --- a/LocalPackages/Subscription/Package.swift +++ b/LocalPackages/Subscription/Package.swift @@ -28,6 +28,9 @@ let package = Package( resources: [ .process("Resources") ], + swiftSettings: [ + .define("DEBUG", .when(configuration: .debug)) + ], plugins: [.plugin(name: "SwiftLintPlugin", package: "BrowserServicesKit")] ), .testTarget( diff --git a/LocalPackages/SwiftUIExtensions/Package.swift b/LocalPackages/SwiftUIExtensions/Package.swift index 2a748e9b07..74ac671569 100644 --- a/LocalPackages/SwiftUIExtensions/Package.swift +++ b/LocalPackages/SwiftUIExtensions/Package.swift @@ -19,6 +19,9 @@ let package = Package( .target( name: "SwiftUIExtensions", dependencies: [], + swiftSettings: [ + .define("DEBUG", .when(configuration: .debug)) + ], plugins: [.plugin(name: "SwiftLintPlugin", package: "BrowserServicesKit")] ), ] diff --git a/LocalPackages/SyncUI/Package.swift b/LocalPackages/SyncUI/Package.swift index 9e594989be..d518f62a27 100644 --- a/LocalPackages/SyncUI/Package.swift +++ b/LocalPackages/SyncUI/Package.swift @@ -21,6 +21,9 @@ let package = Package( dependencies: [ .product(name: "SwiftUIExtensions", package: "SwiftUIExtensions") ], + swiftSettings: [ + .define("DEBUG", .when(configuration: .debug)) + ], plugins: [.plugin(name: "SwiftLintPlugin", package: "BrowserServicesKit")] ), .testTarget( diff --git a/LocalPackages/SystemExtensionManager/Package.swift b/LocalPackages/SystemExtensionManager/Package.swift index 0520b2450d..f0e1cb92b0 100644 --- a/LocalPackages/SystemExtensionManager/Package.swift +++ b/LocalPackages/SystemExtensionManager/Package.swift @@ -23,6 +23,9 @@ let package = Package( // Targets can depend on other targets in this package and products from dependencies. .target( name: "SystemExtensionManager", + swiftSettings: [ + .define("DEBUG", .when(configuration: .debug)) + ], plugins: [.plugin(name: "SwiftLintPlugin", package: "BrowserServicesKit")] ) ] diff --git a/LocalPackages/XPCHelper/Package.swift b/LocalPackages/XPCHelper/Package.swift index 769640d83b..c6cfe8e98a 100644 --- a/LocalPackages/XPCHelper/Package.swift +++ b/LocalPackages/XPCHelper/Package.swift @@ -38,6 +38,9 @@ let package = Package( .target( name: "XPCHelper", dependencies: [], + swiftSettings: [ + .define("DEBUG", .when(configuration: .debug)) + ], plugins: [.plugin(name: "SwiftLintPlugin", package: "BrowserServicesKit")] ) ] From 5afadaa0807777ad10d3e5ef16e955d06c340fcf Mon Sep 17 00:00:00 2001 From: Alexey Martemyanov Date: Thu, 7 Dec 2023 13:41:46 +0600 Subject: [PATCH 13/21] Package.resolved --- .../xcshareddata/swiftpm/Package.resolved | 148 ++++++++++++++++++ 1 file changed, 148 insertions(+) create mode 100644 DuckDuckGo.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved diff --git a/DuckDuckGo.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved b/DuckDuckGo.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved new file mode 100644 index 0000000000..43a5da0335 --- /dev/null +++ b/DuckDuckGo.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved @@ -0,0 +1,148 @@ +{ + "pins" : [ + { + "identity" : "bloom_cpp", + "kind" : "remoteSourceControl", + "location" : "https://github.com/duckduckgo/bloom_cpp.git", + "state" : { + "revision" : "8076199456290b61b4544bf2f4caf296759906a0", + "version" : "3.0.0" + } + }, + { + "identity" : "browserserviceskit", + "kind" : "remoteSourceControl", + "location" : "https://github.com/duckduckgo/BrowserServicesKit", + "state" : { + "revision" : "fb25ff6a2945448213b8422b6a7416ee48802278" + } + }, + { + "identity" : "content-scope-scripts", + "kind" : "remoteSourceControl", + "location" : "https://github.com/duckduckgo/content-scope-scripts", + "state" : { + "revision" : "b7ad9843e70cede0c2ca9c4260d970f62cb28156", + "version" : "4.52.0" + } + }, + { + "identity" : "duckduckgo-autofill", + "kind" : "remoteSourceControl", + "location" : "https://github.com/duckduckgo/duckduckgo-autofill.git", + "state" : { + "revision" : "93677cc02cfe650ce7f417246afd0e8e972cd83e", + "version" : "10.0.0" + } + }, + { + "identity" : "grdb.swift", + "kind" : "remoteSourceControl", + "location" : "https://github.com/duckduckgo/GRDB.swift.git", + "state" : { + "revision" : "77d9a83191a74e319a5cfa27b0e3145d15607573", + "version" : "2.2.0" + } + }, + { + "identity" : "lottie-ios", + "kind" : "remoteSourceControl", + "location" : "https://github.com/duckduckgo/lottie-ios.git", + "state" : { + "revision" : "abf5510e261c85ffddd29de0bca9b72592ea2bdd", + "version" : "3.3.0" + } + }, + { + "identity" : "ohhttpstubs", + "kind" : "remoteSourceControl", + "location" : "https://github.com/AliSoftware/OHHTTPStubs.git", + "state" : { + "revision" : "12f19662426d0434d6c330c6974d53e2eb10ecd9", + "version" : "9.1.0" + } + }, + { + "identity" : "openssl-xcframework", + "kind" : "remoteSourceControl", + "location" : "https://github.com/duckduckgo/OpenSSL-XCFramework", + "state" : { + "revision" : "bb7bfc010ef4d2e7913c343663b167e2a984ac79", + "version" : "3.1.2000" + } + }, + { + "identity" : "privacy-dashboard", + "kind" : "remoteSourceControl", + "location" : "https://github.com/duckduckgo/privacy-dashboard", + "state" : { + "revision" : "38336a574e13090764ba09a6b877d15ee514e371", + "version" : "3.1.1" + } + }, + { + "identity" : "punycodeswift", + "kind" : "remoteSourceControl", + "location" : "https://github.com/gumob/PunycodeSwift.git", + "state" : { + "revision" : "4356ec54e073741449640d3d50a1fd24fd1e1b8b", + "version" : "2.1.0" + } + }, + { + "identity" : "sparkle", + "kind" : "remoteSourceControl", + "location" : "https://github.com/sparkle-project/Sparkle.git", + "state" : { + "revision" : "1f07f4096e52f19b5e7abaa697b7fc592b7ff57c", + "version" : "2.5.1" + } + }, + { + "identity" : "swift-argument-parser", + "kind" : "remoteSourceControl", + "location" : "https://github.com/apple/swift-argument-parser", + "state" : { + "revision" : "8f4d2753f0e4778c76d5f05ad16c74f707390531", + "version" : "1.2.3" + } + }, + { + "identity" : "swifter", + "kind" : "remoteSourceControl", + "location" : "https://github.com/httpswift/swifter.git", + "state" : { + "revision" : "9483a5d459b45c3ffd059f7b55f9638e268632fd", + "version" : "1.5.0" + } + }, + { + "identity" : "sync_crypto", + "kind" : "remoteSourceControl", + "location" : "https://github.com/duckduckgo/sync_crypto", + "state" : { + "revision" : "2ab6ab6f0f96b259c14c2de3fc948935fc16ac78", + "version" : "0.2.0" + } + }, + { + "identity" : "trackerradarkit", + "kind" : "remoteSourceControl", + "location" : "https://github.com/duckduckgo/TrackerRadarKit.git", + "state" : { + "revision" : "a6b7ba151d9dc6684484f3785293875ec01cc1ff", + "version" : "1.2.2" + } + }, + { + "identity" : "wireguard-apple", + "kind" : "remoteSourceControl", + "location" : "https://github.com/duckduckgo/wireguard-apple", + "state" : { + "revision" : "2d8172c11478ab11b0f5ad49bdb4f93f4b3d5e0d", + "version" : "1.1.1" + } + } + ], + "version" : 2 +} From 652b9c1b9e8093037c88f1209abb5424c9fd159b Mon Sep 17 00:00:00 2001 From: Alexey Martemyanov Date: Thu, 7 Dec 2023 14:42:59 +0600 Subject: [PATCH 14/21] fix file headers; allow zero lintable files --- .swiftlint.tests.yml | 4 +++- .swiftlint.yml | 4 +++- DuckDuckGo.xcodeproj/project.pbxproj | 2 +- .../project.xcworkspace/xcshareddata/swiftpm/Package.resolved | 2 +- DuckDuckGo/Bookmarks/Legacy/LegacyBookmarkStore.swift | 2 +- .../Bookmarks/View/BookmarkAddPopoverViewController.swift | 2 +- DuckDuckGo/Common/Database/Stored.swift | 2 +- DuckDuckGo/Configuration/ConfigurationStore.swift | 2 +- DuckDuckGo/DBP/LoginItem+DataBrokerProtection.swift | 2 +- DuckDuckGo/HomePage/Model/DataImportStatusProviding.swift | 2 +- DuckDuckGo/Menus/CleanThisHistoryMenuItem.swift | 2 +- .../BadgeAnimations/NavigationBarBadgeAnimator.swift | 2 +- .../NetworkProtectionPixelEvent.swift | 2 +- .../UserDefaults+NetworkProtectionWaitlist.swift | 2 +- .../BothAppTargets/EventMapping+NetworkProtectionError.swift | 2 +- .../Invite/NetworkProtectionInvitePresenter.swift | 2 +- .../BothAppTargets/LoginItem+NetworkProtection.swift | 2 +- .../NetworkProtectionControllerErrorStore.swift | 2 +- .../NetworkProtectionNavBarPopoverManager.swift | 2 +- .../NetworkProtectionIPCTunnelController.swift | 2 +- .../UserText+NetworkProtectionExtensions.swift | 2 +- DuckDuckGo/PasswordManager/Bitwarden/Model/BWStatus.swift | 2 +- DuckDuckGo/Preferences/Model/VPNPreferencesModel.swift | 2 +- DuckDuckGo/Preferences/View/PreferencesVPNView.swift | 2 +- DuckDuckGo/RecentlyClosed/Model/RecentlyClosedCacheItem.swift | 2 +- DuckDuckGo/Suggestions/View/SuggestionViewController.swift | 2 +- DuckDuckGo/Tab/Model/Tab+UIDelegate.swift | 2 +- DuckDuckGo/Waitlist/Views/WaitlistRootView.swift | 2 +- .../DataBrokerProtectionBackgroundManager.swift | 2 +- .../DuckDuckGoDBPBackgroundAgentAppDelegate.swift | 2 +- LocalPackages/Account/Tests/AccountTests/AccountsTests.swift | 2 +- .../BuildToolPlugins/Plugins/InputFilesChecker/Errors.swift | 2 +- .../Plugins/InputFilesChecker/InputFilesChecker.swift | 2 +- .../DebugUI/DataBrokerDatabaseBrowserView.swift | 2 +- .../IPC/DataBrokerProtectionIPCServer.swift | 2 +- .../Sources/DataBrokerProtection/Model/Actions/Navigate.swift | 2 +- .../Sources/DataBrokerProtection/Model/DBPUIViewModel.swift | 2 +- .../Operations/DataBrokerOperationRunner.swift | 2 +- .../Operations/DataBrokerProtectionBrokerUpdater.swift | 2 +- .../Scheduler/DataBrokerProtectionNoOpScheduler.swift | 2 +- .../Sources/DataBrokerProtection/Services/EmailService.swift | 2 +- .../DataBrokerProtection/Services/RedeemCodeServices.swift | 2 +- .../DataBrokerProtectionInviteCodeViewModels.swift | 2 +- .../DataBrokerProtectionInviteDialogsView.swift | 2 +- .../Sources/DataBrokerProtection/Utils/CodableExtension.swift | 2 +- .../Utils/DataBrokerProtectionNotifications.swift | 2 +- .../DataBrokerProfileQueryOperationManagerTests.swift | 2 +- .../Extensions/UserText+NetworkProtectionUI.swift | 2 +- .../Views/TunnelControllerView/TunnelControllerView.swift | 2 +- .../NetworkProtectionAssetTests.swift | 2 +- .../Sources/SwiftUIExtensions/LetterIconView.swift | 2 +- .../Sources/SwiftUIExtensions/NativeCheckBoxToggle.swift | 2 +- .../Sources/SwiftUIExtensions/View+Link.swift | 2 +- .../Sources/SwiftUIExtensions/View+Visibility.swift | 2 +- .../SyncUI/Sources/SyncUI/Views/internal/SyncUIViews.swift | 2 +- .../NetworkProtectionAgentNotificationsPresenter.swift | 2 +- 56 files changed, 60 insertions(+), 56 deletions(-) diff --git a/.swiftlint.tests.yml b/.swiftlint.tests.yml index 8ec8efeb37..d208ea471a 100644 --- a/.swiftlint.tests.yml +++ b/.swiftlint.tests.yml @@ -1,5 +1,7 @@ # swiftlint config applied for Tests +allow_zero_lintable_files: true + disabled_rules: - no_space_in_method_call - multiple_closures_with_trailing_closure @@ -35,7 +37,7 @@ large_tuple: file_header: required_pattern: | \/\/ - \/\/ .*?\.swift + \/\/ SWIFTLINT_CURRENT_FILENAME \/\/ \/\/ Copyright © \d{4} DuckDuckGo\. All rights reserved\. \/\/ diff --git a/.swiftlint.yml b/.swiftlint.yml index 40ef1d7bf3..32a285b23b 100644 --- a/.swiftlint.yml +++ b/.swiftlint.yml @@ -1,3 +1,5 @@ +allow_zero_lintable_files: true + disabled_rules: - no_space_in_method_call - multiple_closures_with_trailing_closure @@ -49,7 +51,7 @@ large_tuple: file_header: required_pattern: | \/\/ - \/\/ .*?\.swift + \/\/ SWIFTLINT_CURRENT_FILENAME \/\/ \/\/ Copyright © \d{4} DuckDuckGo\. All rights reserved\. \/\/ diff --git a/DuckDuckGo.xcodeproj/project.pbxproj b/DuckDuckGo.xcodeproj/project.pbxproj index a794b66ed8..6cff2dccb2 100644 --- a/DuckDuckGo.xcodeproj/project.pbxproj +++ b/DuckDuckGo.xcodeproj/project.pbxproj @@ -12773,7 +12773,7 @@ repositoryURL = "https://github.com/duckduckgo/BrowserServicesKit"; requirement = { kind = revision; - revision = fb25ff6a2945448213b8422b6a7416ee48802278; + revision = aa3c9acb1e5e3afd3b943e538868d61db19a9a8d; }; }; AA06B6B52672AF8100F541C5 /* XCRemoteSwiftPackageReference "Sparkle" */ = { diff --git a/DuckDuckGo.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved b/DuckDuckGo.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved index 43a5da0335..6af271a881 100644 --- a/DuckDuckGo.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved +++ b/DuckDuckGo.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved @@ -14,7 +14,7 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/duckduckgo/BrowserServicesKit", "state" : { - "revision" : "fb25ff6a2945448213b8422b6a7416ee48802278" + "revision" : "aa3c9acb1e5e3afd3b943e538868d61db19a9a8d" } }, { diff --git a/DuckDuckGo/Bookmarks/Legacy/LegacyBookmarkStore.swift b/DuckDuckGo/Bookmarks/Legacy/LegacyBookmarkStore.swift index 145ef4e994..9634ca221f 100644 --- a/DuckDuckGo/Bookmarks/Legacy/LegacyBookmarkStore.swift +++ b/DuckDuckGo/Bookmarks/Legacy/LegacyBookmarkStore.swift @@ -1,5 +1,5 @@ // -// BookmarkStore.swift +// LegacyBookmarkStore.swift // // Copyright © 2023 DuckDuckGo. All rights reserved. // diff --git a/DuckDuckGo/Bookmarks/View/BookmarkAddPopoverViewController.swift b/DuckDuckGo/Bookmarks/View/BookmarkAddPopoverViewController.swift index 55fe78d279..53493da240 100644 --- a/DuckDuckGo/Bookmarks/View/BookmarkAddPopoverViewController.swift +++ b/DuckDuckGo/Bookmarks/View/BookmarkAddPopoverViewController.swift @@ -1,5 +1,5 @@ // -// BookmarkPopoverViewController.swift +// BookmarkAddPopoverViewController.swift // // Copyright © 2021 DuckDuckGo. All rights reserved. // diff --git a/DuckDuckGo/Common/Database/Stored.swift b/DuckDuckGo/Common/Database/Stored.swift index bda6c63a35..69f2c40de1 100644 --- a/DuckDuckGo/Common/Database/Stored.swift +++ b/DuckDuckGo/Common/Database/Stored.swift @@ -1,5 +1,5 @@ // -// StoredObject.swift +// Stored.swift // // Copyright © 2022 DuckDuckGo. All rights reserved. // diff --git a/DuckDuckGo/Configuration/ConfigurationStore.swift b/DuckDuckGo/Configuration/ConfigurationStore.swift index 15891111a3..179e5addd7 100644 --- a/DuckDuckGo/Configuration/ConfigurationStore.swift +++ b/DuckDuckGo/Configuration/ConfigurationStore.swift @@ -1,5 +1,5 @@ // -// ConfigurationStoring.swift +// ConfigurationStore.swift // // Copyright © 2021 DuckDuckGo. All rights reserved. // diff --git a/DuckDuckGo/DBP/LoginItem+DataBrokerProtection.swift b/DuckDuckGo/DBP/LoginItem+DataBrokerProtection.swift index 50413b3acf..e1e00e38c7 100644 --- a/DuckDuckGo/DBP/LoginItem+DataBrokerProtection.swift +++ b/DuckDuckGo/DBP/LoginItem+DataBrokerProtection.swift @@ -1,5 +1,5 @@ // -// LoginItem.swift +// LoginItem+DataBrokerProtection.swift // // Copyright © 2023 DuckDuckGo. All rights reserved. // diff --git a/DuckDuckGo/HomePage/Model/DataImportStatusProviding.swift b/DuckDuckGo/HomePage/Model/DataImportStatusProviding.swift index 026e1582f0..3ce04a4a41 100644 --- a/DuckDuckGo/HomePage/Model/DataImportStatusProviding.swift +++ b/DuckDuckGo/HomePage/Model/DataImportStatusProviding.swift @@ -1,5 +1,5 @@ // -// DataImportProvider.swift +// DataImportStatusProviding.swift // // Copyright © 2023 DuckDuckGo. All rights reserved. // diff --git a/DuckDuckGo/Menus/CleanThisHistoryMenuItem.swift b/DuckDuckGo/Menus/CleanThisHistoryMenuItem.swift index 6221131fb0..f21f662eea 100644 --- a/DuckDuckGo/Menus/CleanThisHistoryMenuItem.swift +++ b/DuckDuckGo/Menus/CleanThisHistoryMenuItem.swift @@ -1,5 +1,5 @@ // -// ClearThisHistoryMenuItem.swift +// CleanThisHistoryMenuItem.swift // // Copyright © 2022 DuckDuckGo. All rights reserved. // diff --git a/DuckDuckGo/NavigationBar/View/Animations/BadgeAnimations/NavigationBarBadgeAnimator.swift b/DuckDuckGo/NavigationBar/View/Animations/BadgeAnimations/NavigationBarBadgeAnimator.swift index e6777985bd..61a00d108b 100644 --- a/DuckDuckGo/NavigationBar/View/Animations/BadgeAnimations/NavigationBarBadgeAnimator.swift +++ b/DuckDuckGo/NavigationBar/View/Animations/BadgeAnimations/NavigationBarBadgeAnimator.swift @@ -1,5 +1,5 @@ // -// AddressBarButtonsBadgeAnimator.swift +// NavigationBarBadgeAnimator.swift // // Copyright © 2022 DuckDuckGo. All rights reserved. // diff --git a/DuckDuckGo/NetworkProtection/AppAndExtensionAndAgentTargets/NetworkProtectionPixelEvent.swift b/DuckDuckGo/NetworkProtection/AppAndExtensionAndAgentTargets/NetworkProtectionPixelEvent.swift index 8be2340643..275239c509 100644 --- a/DuckDuckGo/NetworkProtection/AppAndExtensionAndAgentTargets/NetworkProtectionPixelEvent.swift +++ b/DuckDuckGo/NetworkProtection/AppAndExtensionAndAgentTargets/NetworkProtectionPixelEvent.swift @@ -1,5 +1,5 @@ // -// NetworkProtectionPixel.swift +// NetworkProtectionPixelEvent.swift // // Copyright © 2023 DuckDuckGo. All rights reserved. // diff --git a/DuckDuckGo/NetworkProtection/AppAndExtensionAndAgentTargets/UserDefaults+NetworkProtectionWaitlist.swift b/DuckDuckGo/NetworkProtection/AppAndExtensionAndAgentTargets/UserDefaults+NetworkProtectionWaitlist.swift index e48aafc37c..c557fb2605 100644 --- a/DuckDuckGo/NetworkProtection/AppAndExtensionAndAgentTargets/UserDefaults+NetworkProtectionWaitlist.swift +++ b/DuckDuckGo/NetworkProtection/AppAndExtensionAndAgentTargets/UserDefaults+NetworkProtectionWaitlist.swift @@ -1,5 +1,5 @@ // -// PrivacyFeatureOverrideStore.swift +// UserDefaults+NetworkProtectionWaitlist.swift // // Copyright © 2023 DuckDuckGo. All rights reserved. // diff --git a/DuckDuckGo/NetworkProtection/AppTargets/BothAppTargets/EventMapping+NetworkProtectionError.swift b/DuckDuckGo/NetworkProtection/AppTargets/BothAppTargets/EventMapping+NetworkProtectionError.swift index 78883281fa..7d8124b432 100644 --- a/DuckDuckGo/NetworkProtection/AppTargets/BothAppTargets/EventMapping+NetworkProtectionError.swift +++ b/DuckDuckGo/NetworkProtection/AppTargets/BothAppTargets/EventMapping+NetworkProtectionError.swift @@ -1,5 +1,5 @@ // -// NetworkProtectionDeviceManager+EventMapping.swift +// EventMapping+NetworkProtectionError.swift // // Copyright © 2023 DuckDuckGo. All rights reserved. // diff --git a/DuckDuckGo/NetworkProtection/AppTargets/BothAppTargets/Invite/NetworkProtectionInvitePresenter.swift b/DuckDuckGo/NetworkProtection/AppTargets/BothAppTargets/Invite/NetworkProtectionInvitePresenter.swift index 9133f5201d..f80e5eb093 100644 --- a/DuckDuckGo/NetworkProtection/AppTargets/BothAppTargets/Invite/NetworkProtectionInvitePresenter.swift +++ b/DuckDuckGo/NetworkProtection/AppTargets/BothAppTargets/Invite/NetworkProtectionInvitePresenter.swift @@ -1,5 +1,5 @@ // -// NetworkProtectionVisibilityController.swift +// NetworkProtectionInvitePresenter.swift // // Copyright © 2023 DuckDuckGo. All rights reserved. // diff --git a/DuckDuckGo/NetworkProtection/AppTargets/BothAppTargets/LoginItem+NetworkProtection.swift b/DuckDuckGo/NetworkProtection/AppTargets/BothAppTargets/LoginItem+NetworkProtection.swift index 38caf2dc7c..a34f1d0faa 100644 --- a/DuckDuckGo/NetworkProtection/AppTargets/BothAppTargets/LoginItem+NetworkProtection.swift +++ b/DuckDuckGo/NetworkProtection/AppTargets/BothAppTargets/LoginItem+NetworkProtection.swift @@ -1,5 +1,5 @@ // -// LoginItem.swift +// LoginItem+NetworkProtection.swift // // Copyright © 2023 DuckDuckGo. All rights reserved. // diff --git a/DuckDuckGo/NetworkProtection/AppTargets/BothAppTargets/NetworkProtectionControllerErrorStore.swift b/DuckDuckGo/NetworkProtection/AppTargets/BothAppTargets/NetworkProtectionControllerErrorStore.swift index 6b615db3ad..62503023be 100644 --- a/DuckDuckGo/NetworkProtection/AppTargets/BothAppTargets/NetworkProtectionControllerErrorStore.swift +++ b/DuckDuckGo/NetworkProtection/AppTargets/BothAppTargets/NetworkProtectionControllerErrorStore.swift @@ -1,5 +1,5 @@ // -// NetworkProtectionControllerIssuesStore.swift +// NetworkProtectionControllerErrorStore.swift // // Copyright © 2023 DuckDuckGo. All rights reserved. // diff --git a/DuckDuckGo/NetworkProtection/AppTargets/BothAppTargets/NetworkProtectionNavBarPopoverManager.swift b/DuckDuckGo/NetworkProtection/AppTargets/BothAppTargets/NetworkProtectionNavBarPopoverManager.swift index 64b5642fe3..6d811b056a 100644 --- a/DuckDuckGo/NetworkProtection/AppTargets/BothAppTargets/NetworkProtectionNavBarPopoverManager.swift +++ b/DuckDuckGo/NetworkProtection/AppTargets/BothAppTargets/NetworkProtectionNavBarPopoverManager.swift @@ -1,5 +1,5 @@ // -// NetworkProtectionNavBarPopoverModel.swift +// NetworkProtectionNavBarPopoverManager.swift // // Copyright © 2023 DuckDuckGo. All rights reserved. // diff --git a/DuckDuckGo/NetworkProtection/AppTargets/DeveloperIDTarget/NetworkProtectionIPCTunnelController.swift b/DuckDuckGo/NetworkProtection/AppTargets/DeveloperIDTarget/NetworkProtectionIPCTunnelController.swift index ffe7a832b7..ada65d6335 100644 --- a/DuckDuckGo/NetworkProtection/AppTargets/DeveloperIDTarget/NetworkProtectionIPCTunnelController.swift +++ b/DuckDuckGo/NetworkProtection/AppTargets/DeveloperIDTarget/NetworkProtectionIPCTunnelController.swift @@ -1,5 +1,5 @@ // -// NetworkProtectionIPCClient.swift +// NetworkProtectionIPCTunnelController.swift // // Copyright © 2023 DuckDuckGo. All rights reserved. // diff --git a/DuckDuckGo/NetworkProtection/NetworkExtensionTargets/NetworkExtensionAndNotificationTargets/UserText+NetworkProtectionExtensions.swift b/DuckDuckGo/NetworkProtection/NetworkExtensionTargets/NetworkExtensionAndNotificationTargets/UserText+NetworkProtectionExtensions.swift index 6395cd11b0..2befdf07ce 100644 --- a/DuckDuckGo/NetworkProtection/NetworkExtensionTargets/NetworkExtensionAndNotificationTargets/UserText+NetworkProtectionExtensions.swift +++ b/DuckDuckGo/NetworkProtection/NetworkExtensionTargets/NetworkExtensionAndNotificationTargets/UserText+NetworkProtectionExtensions.swift @@ -1,5 +1,5 @@ // -// UserText.swift +// UserText+NetworkProtectionExtensions.swift // // Copyright © 2023 DuckDuckGo. All rights reserved. // diff --git a/DuckDuckGo/PasswordManager/Bitwarden/Model/BWStatus.swift b/DuckDuckGo/PasswordManager/Bitwarden/Model/BWStatus.swift index f7f4d0479d..05b1193940 100644 --- a/DuckDuckGo/PasswordManager/Bitwarden/Model/BWStatus.swift +++ b/DuckDuckGo/PasswordManager/Bitwarden/Model/BWStatus.swift @@ -1,5 +1,5 @@ // -// BitwardenState.swift +// BWStatus.swift // // Copyright © 2022 DuckDuckGo. All rights reserved. // diff --git a/DuckDuckGo/Preferences/Model/VPNPreferencesModel.swift b/DuckDuckGo/Preferences/Model/VPNPreferencesModel.swift index 453a505449..095d63be96 100644 --- a/DuckDuckGo/Preferences/Model/VPNPreferencesModel.swift +++ b/DuckDuckGo/Preferences/Model/VPNPreferencesModel.swift @@ -1,5 +1,5 @@ // -// PrivacyPreferencesModel.swift +// VPNPreferencesModel.swift // // Copyright © 2022 DuckDuckGo. All rights reserved. // diff --git a/DuckDuckGo/Preferences/View/PreferencesVPNView.swift b/DuckDuckGo/Preferences/View/PreferencesVPNView.swift index b30d3b8358..ffecd5b0c2 100644 --- a/DuckDuckGo/Preferences/View/PreferencesVPNView.swift +++ b/DuckDuckGo/Preferences/View/PreferencesVPNView.swift @@ -1,5 +1,5 @@ // -// PreferencesPrivacyView.swift +// PreferencesVPNView.swift // // Copyright © 2022 DuckDuckGo. All rights reserved. // diff --git a/DuckDuckGo/RecentlyClosed/Model/RecentlyClosedCacheItem.swift b/DuckDuckGo/RecentlyClosed/Model/RecentlyClosedCacheItem.swift index 8daac76c51..3314b3da2a 100644 --- a/DuckDuckGo/RecentlyClosed/Model/RecentlyClosedCacheItem.swift +++ b/DuckDuckGo/RecentlyClosed/Model/RecentlyClosedCacheItem.swift @@ -1,5 +1,5 @@ // -// RecentlyClosedTabsCacheItem.swift +// RecentlyClosedCacheItem.swift // // Copyright © 2022 DuckDuckGo. All rights reserved. // diff --git a/DuckDuckGo/Suggestions/View/SuggestionViewController.swift b/DuckDuckGo/Suggestions/View/SuggestionViewController.swift index cd04ff8a69..44442c1f86 100644 --- a/DuckDuckGo/Suggestions/View/SuggestionViewController.swift +++ b/DuckDuckGo/Suggestions/View/SuggestionViewController.swift @@ -1,5 +1,5 @@ // -// SearchSuggestionViewController.swift +// SuggestionViewController.swift // // Copyright © 2020 DuckDuckGo. All rights reserved. // diff --git a/DuckDuckGo/Tab/Model/Tab+UIDelegate.swift b/DuckDuckGo/Tab/Model/Tab+UIDelegate.swift index c87cd89b93..038e9104bf 100644 --- a/DuckDuckGo/Tab/Model/Tab+UIDelegate.swift +++ b/DuckDuckGo/Tab/Model/Tab+UIDelegate.swift @@ -1,5 +1,5 @@ // -// TabUIDelegate.swift +// Tab+UIDelegate.swift // // Copyright © 2022 DuckDuckGo. All rights reserved. // diff --git a/DuckDuckGo/Waitlist/Views/WaitlistRootView.swift b/DuckDuckGo/Waitlist/Views/WaitlistRootView.swift index a2d34a601b..d4cd80abd5 100644 --- a/DuckDuckGo/Waitlist/Views/WaitlistRootView.swift +++ b/DuckDuckGo/Waitlist/Views/WaitlistRootView.swift @@ -1,5 +1,5 @@ // -// NetworkProtectionWaitlistRootView.swift +// WaitlistRootView.swift // // Copyright © 2023 DuckDuckGo. All rights reserved. // diff --git a/DuckDuckGoDBPBackgroundAgent/DataBrokerProtectionBackgroundManager.swift b/DuckDuckGoDBPBackgroundAgent/DataBrokerProtectionBackgroundManager.swift index 306f6b8b8e..6105595764 100644 --- a/DuckDuckGoDBPBackgroundAgent/DataBrokerProtectionBackgroundManager.swift +++ b/DuckDuckGoDBPBackgroundAgent/DataBrokerProtectionBackgroundManager.swift @@ -1,5 +1,5 @@ // -// DataBrokerProtectionManager.swift +// DataBrokerProtectionBackgroundManager.swift // // Copyright © 2023 DuckDuckGo. All rights reserved. // diff --git a/DuckDuckGoDBPBackgroundAgent/DuckDuckGoDBPBackgroundAgentAppDelegate.swift b/DuckDuckGoDBPBackgroundAgent/DuckDuckGoDBPBackgroundAgentAppDelegate.swift index 897d97d7ee..f2ac32192a 100644 --- a/DuckDuckGoDBPBackgroundAgent/DuckDuckGoDBPBackgroundAgentAppDelegate.swift +++ b/DuckDuckGoDBPBackgroundAgent/DuckDuckGoDBPBackgroundAgentAppDelegate.swift @@ -1,5 +1,5 @@ // -// DuckDuckGoAgentAppDelegate.swift +// DuckDuckGoDBPBackgroundAgentAppDelegate.swift // // Copyright © 2023 DuckDuckGo. All rights reserved. // diff --git a/LocalPackages/Account/Tests/AccountTests/AccountsTests.swift b/LocalPackages/Account/Tests/AccountTests/AccountsTests.swift index 09f797525f..a34e6849f8 100644 --- a/LocalPackages/Account/Tests/AccountTests/AccountsTests.swift +++ b/LocalPackages/Account/Tests/AccountTests/AccountsTests.swift @@ -1,5 +1,5 @@ // -// AccountTests.swift +// AccountsTests.swift // // Copyright © 2023 DuckDuckGo. All rights reserved. // diff --git a/LocalPackages/BuildToolPlugins/Plugins/InputFilesChecker/Errors.swift b/LocalPackages/BuildToolPlugins/Plugins/InputFilesChecker/Errors.swift index e6badea5c7..8ae40f2703 100644 --- a/LocalPackages/BuildToolPlugins/Plugins/InputFilesChecker/Errors.swift +++ b/LocalPackages/BuildToolPlugins/Plugins/InputFilesChecker/Errors.swift @@ -1,5 +1,5 @@ // -// TargetSourcesChecker.swift +// Errors.swift // // Copyright © 2022 DuckDuckGo. All rights reserved. // diff --git a/LocalPackages/BuildToolPlugins/Plugins/InputFilesChecker/InputFilesChecker.swift b/LocalPackages/BuildToolPlugins/Plugins/InputFilesChecker/InputFilesChecker.swift index 5eb9a976e9..1d9c4bc953 100644 --- a/LocalPackages/BuildToolPlugins/Plugins/InputFilesChecker/InputFilesChecker.swift +++ b/LocalPackages/BuildToolPlugins/Plugins/InputFilesChecker/InputFilesChecker.swift @@ -1,5 +1,5 @@ // -// TargetSourcesChecker.swift +// InputFilesChecker.swift // // Copyright © 2022 DuckDuckGo. All rights reserved. // diff --git a/LocalPackages/DataBrokerProtection/Sources/DataBrokerProtection/DebugUI/DataBrokerDatabaseBrowserView.swift b/LocalPackages/DataBrokerProtection/Sources/DataBrokerProtection/DebugUI/DataBrokerDatabaseBrowserView.swift index f3b93bc067..18b5ffa6b6 100644 --- a/LocalPackages/DataBrokerProtection/Sources/DataBrokerProtection/DebugUI/DataBrokerDatabaseBrowserView.swift +++ b/LocalPackages/DataBrokerProtection/Sources/DataBrokerProtection/DebugUI/DataBrokerDatabaseBrowserView.swift @@ -1,5 +1,5 @@ // -// DataBrokerDataBaseBrowserView.swift +// DataBrokerDatabaseBrowserView.swift // // Copyright © 2023 DuckDuckGo. All rights reserved. // diff --git a/LocalPackages/DataBrokerProtection/Sources/DataBrokerProtection/IPC/DataBrokerProtectionIPCServer.swift b/LocalPackages/DataBrokerProtection/Sources/DataBrokerProtection/IPC/DataBrokerProtectionIPCServer.swift index b0527a88e0..fde0274a5f 100644 --- a/LocalPackages/DataBrokerProtection/Sources/DataBrokerProtection/IPC/DataBrokerProtectionIPCServer.swift +++ b/LocalPackages/DataBrokerProtection/Sources/DataBrokerProtection/IPC/DataBrokerProtectionIPCServer.swift @@ -1,5 +1,5 @@ // -// TunnelControllerIPCServer.swift +// DataBrokerProtectionIPCServer.swift // // Copyright © 2023 DuckDuckGo. All rights reserved. // diff --git a/LocalPackages/DataBrokerProtection/Sources/DataBrokerProtection/Model/Actions/Navigate.swift b/LocalPackages/DataBrokerProtection/Sources/DataBrokerProtection/Model/Actions/Navigate.swift index 79b086c1d7..03dd465d80 100644 --- a/LocalPackages/DataBrokerProtection/Sources/DataBrokerProtection/Model/Actions/Navigate.swift +++ b/LocalPackages/DataBrokerProtection/Sources/DataBrokerProtection/Model/Actions/Navigate.swift @@ -1,5 +1,5 @@ // -// NavigateAction.swift +// Navigate.swift // // Copyright © 2023 DuckDuckGo. All rights reserved. // diff --git a/LocalPackages/DataBrokerProtection/Sources/DataBrokerProtection/Model/DBPUIViewModel.swift b/LocalPackages/DataBrokerProtection/Sources/DataBrokerProtection/Model/DBPUIViewModel.swift index d0d5582032..c0a82d2a1a 100644 --- a/LocalPackages/DataBrokerProtection/Sources/DataBrokerProtection/Model/DBPUIViewModel.swift +++ b/LocalPackages/DataBrokerProtection/Sources/DataBrokerProtection/Model/DBPUIViewModel.swift @@ -1,5 +1,5 @@ // -// DataBrokerProtectionViewController.swift +// DBPUIViewModel.swift // // Copyright © 2023 DuckDuckGo. All rights reserved. // diff --git a/LocalPackages/DataBrokerProtection/Sources/DataBrokerProtection/Operations/DataBrokerOperationRunner.swift b/LocalPackages/DataBrokerProtection/Sources/DataBrokerProtection/Operations/DataBrokerOperationRunner.swift index 936965db50..b15e7e0791 100644 --- a/LocalPackages/DataBrokerProtection/Sources/DataBrokerProtection/Operations/DataBrokerOperationRunner.swift +++ b/LocalPackages/DataBrokerProtection/Sources/DataBrokerProtection/Operations/DataBrokerOperationRunner.swift @@ -1,5 +1,5 @@ // -// WebOperationRunner.swift +// DataBrokerOperationRunner.swift // // Copyright © 2023 DuckDuckGo. All rights reserved. // diff --git a/LocalPackages/DataBrokerProtection/Sources/DataBrokerProtection/Operations/DataBrokerProtectionBrokerUpdater.swift b/LocalPackages/DataBrokerProtection/Sources/DataBrokerProtection/Operations/DataBrokerProtectionBrokerUpdater.swift index 5237ff1846..667890c3d0 100644 --- a/LocalPackages/DataBrokerProtection/Sources/DataBrokerProtection/Operations/DataBrokerProtectionBrokerUpdater.swift +++ b/LocalPackages/DataBrokerProtection/Sources/DataBrokerProtection/Operations/DataBrokerProtectionBrokerUpdater.swift @@ -1,5 +1,5 @@ // -// DataBrokerProtectionUpdater.swift +// DataBrokerProtectionBrokerUpdater.swift // // Copyright © 2023 DuckDuckGo. All rights reserved. // diff --git a/LocalPackages/DataBrokerProtection/Sources/DataBrokerProtection/Scheduler/DataBrokerProtectionNoOpScheduler.swift b/LocalPackages/DataBrokerProtection/Sources/DataBrokerProtection/Scheduler/DataBrokerProtectionNoOpScheduler.swift index 23e564a2c7..98c06019ff 100644 --- a/LocalPackages/DataBrokerProtection/Sources/DataBrokerProtection/Scheduler/DataBrokerProtectionNoOpScheduler.swift +++ b/LocalPackages/DataBrokerProtection/Sources/DataBrokerProtection/Scheduler/DataBrokerProtectionNoOpScheduler.swift @@ -1,5 +1,5 @@ // -// SwiftUIPreviewHelper.swift +// DataBrokerProtectionNoOpScheduler.swift // // Copyright © 2023 DuckDuckGo. All rights reserved. // diff --git a/LocalPackages/DataBrokerProtection/Sources/DataBrokerProtection/Services/EmailService.swift b/LocalPackages/DataBrokerProtection/Sources/DataBrokerProtection/Services/EmailService.swift index 583df33524..2b39f10569 100644 --- a/LocalPackages/DataBrokerProtection/Sources/DataBrokerProtection/Services/EmailService.swift +++ b/LocalPackages/DataBrokerProtection/Sources/DataBrokerProtection/Services/EmailService.swift @@ -1,5 +1,5 @@ // -// DataBrokerProtectionEmailService.swift +// EmailService.swift // // Copyright © 2023 DuckDuckGo. All rights reserved. // diff --git a/LocalPackages/DataBrokerProtection/Sources/DataBrokerProtection/Services/RedeemCodeServices.swift b/LocalPackages/DataBrokerProtection/Sources/DataBrokerProtection/Services/RedeemCodeServices.swift index ae15ce650c..be4e47320c 100644 --- a/LocalPackages/DataBrokerProtection/Sources/DataBrokerProtection/Services/RedeemCodeServices.swift +++ b/LocalPackages/DataBrokerProtection/Sources/DataBrokerProtection/Services/RedeemCodeServices.swift @@ -1,5 +1,5 @@ // -// ReedemCodeServices.swift +// RedeemCodeServices.swift // // Copyright © 2023 DuckDuckGo. All rights reserved. // diff --git a/LocalPackages/DataBrokerProtection/Sources/DataBrokerProtection/UI/InviteCodeFlow/DataBrokerProtectionInviteCodeViewModels.swift b/LocalPackages/DataBrokerProtection/Sources/DataBrokerProtection/UI/InviteCodeFlow/DataBrokerProtectionInviteCodeViewModels.swift index a59110cd64..18d538532e 100644 --- a/LocalPackages/DataBrokerProtection/Sources/DataBrokerProtection/UI/InviteCodeFlow/DataBrokerProtectionInviteCodeViewModels.swift +++ b/LocalPackages/DataBrokerProtection/Sources/DataBrokerProtection/UI/InviteCodeFlow/DataBrokerProtectionInviteCodeViewModels.swift @@ -1,5 +1,5 @@ // -// DataBrokerProtectionInviteCodeView.swift +// DataBrokerProtectionInviteCodeViewModels.swift // // Copyright © 2023 DuckDuckGo. All rights reserved. // diff --git a/LocalPackages/DataBrokerProtection/Sources/DataBrokerProtection/UI/InviteCodeFlow/DataBrokerProtectionInviteDialogsView.swift b/LocalPackages/DataBrokerProtection/Sources/DataBrokerProtection/UI/InviteCodeFlow/DataBrokerProtectionInviteDialogsView.swift index 3634b34dcf..58c47086d1 100644 --- a/LocalPackages/DataBrokerProtection/Sources/DataBrokerProtection/UI/InviteCodeFlow/DataBrokerProtectionInviteDialogsView.swift +++ b/LocalPackages/DataBrokerProtection/Sources/DataBrokerProtection/UI/InviteCodeFlow/DataBrokerProtectionInviteDialogsView.swift @@ -1,5 +1,5 @@ // -// DataBrokerProtectionInviteCodeView.swift +// DataBrokerProtectionInviteDialogsView.swift // // Copyright © 2023 DuckDuckGo. All rights reserved. // diff --git a/LocalPackages/DataBrokerProtection/Sources/DataBrokerProtection/Utils/CodableExtension.swift b/LocalPackages/DataBrokerProtection/Sources/DataBrokerProtection/Utils/CodableExtension.swift index 2bc7022912..46cc1e4a56 100644 --- a/LocalPackages/DataBrokerProtection/Sources/DataBrokerProtection/Utils/CodableExtension.swift +++ b/LocalPackages/DataBrokerProtection/Sources/DataBrokerProtection/Utils/CodableExtension.swift @@ -1,5 +1,5 @@ // -// CodableExtensions.swift +// CodableExtension.swift // // Copyright © 2023 DuckDuckGo. All rights reserved. // diff --git a/LocalPackages/DataBrokerProtection/Sources/DataBrokerProtection/Utils/DataBrokerProtectionNotifications.swift b/LocalPackages/DataBrokerProtection/Sources/DataBrokerProtection/Utils/DataBrokerProtectionNotifications.swift index 65089411ba..0aae115724 100644 --- a/LocalPackages/DataBrokerProtection/Sources/DataBrokerProtection/Utils/DataBrokerProtectionNotifications.swift +++ b/LocalPackages/DataBrokerProtection/Sources/DataBrokerProtection/Utils/DataBrokerProtectionNotifications.swift @@ -1,5 +1,5 @@ // -// DataBrokerNotifications.swift +// DataBrokerProtectionNotifications.swift // // Copyright © 2023 DuckDuckGo. All rights reserved. // diff --git a/LocalPackages/DataBrokerProtection/Tests/DataBrokerProtectionTests/DataBrokerProfileQueryOperationManagerTests.swift b/LocalPackages/DataBrokerProtection/Tests/DataBrokerProtectionTests/DataBrokerProfileQueryOperationManagerTests.swift index 08c6eb5e00..bef3c21452 100644 --- a/LocalPackages/DataBrokerProtection/Tests/DataBrokerProtectionTests/DataBrokerProfileQueryOperationManagerTests.swift +++ b/LocalPackages/DataBrokerProtection/Tests/DataBrokerProtectionTests/DataBrokerProfileQueryOperationManagerTests.swift @@ -1,5 +1,5 @@ // -// OperationsTests.swift +// DataBrokerProfileQueryOperationManagerTests.swift // // Copyright © 2023 DuckDuckGo. All rights reserved. // diff --git a/LocalPackages/NetworkProtectionMac/Sources/NetworkProtectionUI/Extensions/UserText+NetworkProtectionUI.swift b/LocalPackages/NetworkProtectionMac/Sources/NetworkProtectionUI/Extensions/UserText+NetworkProtectionUI.swift index a73363a9c8..0e12f133ce 100644 --- a/LocalPackages/NetworkProtectionMac/Sources/NetworkProtectionUI/Extensions/UserText+NetworkProtectionUI.swift +++ b/LocalPackages/NetworkProtectionMac/Sources/NetworkProtectionUI/Extensions/UserText+NetworkProtectionUI.swift @@ -1,5 +1,5 @@ // -// UserText.swift +// UserText+NetworkProtectionUI.swift // // Copyright © 2022 DuckDuckGo. All rights reserved. // diff --git a/LocalPackages/NetworkProtectionMac/Sources/NetworkProtectionUI/Views/TunnelControllerView/TunnelControllerView.swift b/LocalPackages/NetworkProtectionMac/Sources/NetworkProtectionUI/Views/TunnelControllerView/TunnelControllerView.swift index f7b0286ef6..2101c704da 100644 --- a/LocalPackages/NetworkProtectionMac/Sources/NetworkProtectionUI/Views/TunnelControllerView/TunnelControllerView.swift +++ b/LocalPackages/NetworkProtectionMac/Sources/NetworkProtectionUI/Views/TunnelControllerView/TunnelControllerView.swift @@ -1,5 +1,5 @@ // -// NetworkProtectionStatusView.swift +// TunnelControllerView.swift // // Copyright © 2022 DuckDuckGo. All rights reserved. // diff --git a/LocalPackages/NetworkProtectionMac/Tests/NetworkProtectionUITests/NetworkProtectionAssetTests.swift b/LocalPackages/NetworkProtectionMac/Tests/NetworkProtectionUITests/NetworkProtectionAssetTests.swift index 07915bd363..7386c27aff 100644 --- a/LocalPackages/NetworkProtectionMac/Tests/NetworkProtectionUITests/NetworkProtectionAssetTests.swift +++ b/LocalPackages/NetworkProtectionMac/Tests/NetworkProtectionUITests/NetworkProtectionAssetTests.swift @@ -1,5 +1,5 @@ // -// NetworkProtectionAssetsTests.swift +// NetworkProtectionAssetTests.swift // // Copyright © 2023 DuckDuckGo. All rights reserved. // diff --git a/LocalPackages/SwiftUIExtensions/Sources/SwiftUIExtensions/LetterIconView.swift b/LocalPackages/SwiftUIExtensions/Sources/SwiftUIExtensions/LetterIconView.swift index 3c8203a7af..84cdc2a6ed 100644 --- a/LocalPackages/SwiftUIExtensions/Sources/SwiftUIExtensions/LetterIconView.swift +++ b/LocalPackages/SwiftUIExtensions/Sources/SwiftUIExtensions/LetterIconView.swift @@ -1,5 +1,5 @@ // -// FaviconLetterView.swift +// LetterIconView.swift // // Copyright © 2023 DuckDuckGo. All rights reserved. // diff --git a/LocalPackages/SwiftUIExtensions/Sources/SwiftUIExtensions/NativeCheckBoxToggle.swift b/LocalPackages/SwiftUIExtensions/Sources/SwiftUIExtensions/NativeCheckBoxToggle.swift index fa73a3082e..f5bb9d449d 100644 --- a/LocalPackages/SwiftUIExtensions/Sources/SwiftUIExtensions/NativeCheckBoxToggle.swift +++ b/LocalPackages/SwiftUIExtensions/Sources/SwiftUIExtensions/NativeCheckBoxToggle.swift @@ -1,5 +1,5 @@ // -// NativeCheckboxToggle.swift +// NativeCheckBoxToggle.swift // // Copyright © 2023 DuckDuckGo. All rights reserved. // diff --git a/LocalPackages/SwiftUIExtensions/Sources/SwiftUIExtensions/View+Link.swift b/LocalPackages/SwiftUIExtensions/Sources/SwiftUIExtensions/View+Link.swift index 498c1b7481..907643c980 100644 --- a/LocalPackages/SwiftUIExtensions/Sources/SwiftUIExtensions/View+Link.swift +++ b/LocalPackages/SwiftUIExtensions/Sources/SwiftUIExtensions/View+Link.swift @@ -1,5 +1,5 @@ // -// Link.swift +// View+Link.swift // // Copyright © 2021 DuckDuckGo. All rights reserved. // diff --git a/LocalPackages/SwiftUIExtensions/Sources/SwiftUIExtensions/View+Visibility.swift b/LocalPackages/SwiftUIExtensions/Sources/SwiftUIExtensions/View+Visibility.swift index 76f6c79236..f25fd1f86b 100644 --- a/LocalPackages/SwiftUIExtensions/Sources/SwiftUIExtensions/View+Visibility.swift +++ b/LocalPackages/SwiftUIExtensions/Sources/SwiftUIExtensions/View+Visibility.swift @@ -1,5 +1,5 @@ // -// ViewVisibility.swift +// View+Visibility.swift // // Copyright © 2021 DuckDuckGo. All rights reserved. // diff --git a/LocalPackages/SyncUI/Sources/SyncUI/Views/internal/SyncUIViews.swift b/LocalPackages/SyncUI/Sources/SyncUI/Views/internal/SyncUIViews.swift index 3bbca6f1bd..10e33ed47f 100644 --- a/LocalPackages/SyncUI/Sources/SyncUI/Views/internal/SyncUIViews.swift +++ b/LocalPackages/SyncUI/Sources/SyncUI/Views/internal/SyncUIViews.swift @@ -1,5 +1,5 @@ // -// SyncUIConstants.swift +// SyncUIViews.swift // // Copyright © 2023 DuckDuckGo. All rights reserved. // diff --git a/NetworkProtectionSystemExtension/NetworkProtectionAgentNotificationsPresenter.swift b/NetworkProtectionSystemExtension/NetworkProtectionAgentNotificationsPresenter.swift index 970a73bf55..37bee8c52e 100644 --- a/NetworkProtectionSystemExtension/NetworkProtectionAgentNotificationsPresenter.swift +++ b/NetworkProtectionSystemExtension/NetworkProtectionAgentNotificationsPresenter.swift @@ -1,5 +1,5 @@ // -// NetworkProtectionIPCNotificationsPresenter.swift +// NetworkProtectionAgentNotificationsPresenter.swift // // Copyright © 2023 DuckDuckGo. All rights reserved. // From e9ac5c5a594b4430af939ab958461b2d7fe77218 Mon Sep 17 00:00:00 2001 From: Alexey Martemyanov Date: Thu, 7 Dec 2023 18:59:18 +0600 Subject: [PATCH 15/21] move .swiftlint.tests.yml to tests folder as per-folder .swiftlint.yml --- .swiftlint.tests.yml | 55 ------------------- .swiftlint.yml | 4 +- DuckDuckGo.xcodeproj/project.pbxproj | 2 +- .../xcshareddata/swiftpm/Package.resolved | 6 +- IntegrationTests/.swiftlint.yml | 17 ++++++ UITests/.swiftlint.yml | 17 ++++++ UnitTests/.swiftlint.yml | 17 ++++++ 7 files changed, 56 insertions(+), 62 deletions(-) delete mode 100644 .swiftlint.tests.yml create mode 100644 IntegrationTests/.swiftlint.yml create mode 100644 UITests/.swiftlint.yml create mode 100644 UnitTests/.swiftlint.yml diff --git a/.swiftlint.tests.yml b/.swiftlint.tests.yml deleted file mode 100644 index d208ea471a..0000000000 --- a/.swiftlint.tests.yml +++ /dev/null @@ -1,55 +0,0 @@ -# swiftlint config applied for Tests - -allow_zero_lintable_files: true - -disabled_rules: - - no_space_in_method_call - - multiple_closures_with_trailing_closure - - block_based_kvo - - compiler_protocol_init - - unused_setter_value - - unused_closure_parameter - - line_length - - type_name - - force_cast - - force_try - - function_body_length - - cyclomatic_complexity - - identifier_name - - implicit_getter - - trailing_comma - - blanket_disable_command - - nesting - - type_body_length - - opening_brace - - function_parameter_count - -opt_in_rules: - - file_header - -# Rule Config -file_length: - warning: 1800 - error: 2000 -large_tuple: - warning: 6 - error: 10 -file_header: - required_pattern: | - \/\/ - \/\/ SWIFTLINT_CURRENT_FILENAME - \/\/ - \/\/ Copyright © \d{4} DuckDuckGo\. All rights reserved\. - \/\/ - \/\/ Licensed under the Apache License, Version 2\.0 \(the \"License\"\); - \/\/ you may not use this file except in compliance with the License\. - \/\/ You may obtain a copy of the License at - \/\/ - \/\/ http:\/\/www\.apache\.org\/licenses\/LICENSE-2\.0 - \/\/ - \/\/ Unless required by applicable law or agreed to in writing, software - \/\/ distributed under the License is distributed on an \"AS IS\" BASIS, - \/\/ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied\. - \/\/ See the License for the specific language governing permissions and - \/\/ limitations under the License\. - \/\/ diff --git a/.swiftlint.yml b/.swiftlint.yml index 32a285b23b..7ac4d0cf46 100644 --- a/.swiftlint.yml +++ b/.swiftlint.yml @@ -16,6 +16,7 @@ disabled_rules: opt_in_rules: - file_header + - explicit_init custom_rules: explicit_non_final_class: @@ -71,10 +72,7 @@ file_header: # General Config excluded: - DuckDuckGo/Common/Localizables/UserText.swift - - UnitTests - - IntegrationTests - LocalPackages/*/Package.swift - release - - UITests - vendor - DerivedData diff --git a/DuckDuckGo.xcodeproj/project.pbxproj b/DuckDuckGo.xcodeproj/project.pbxproj index 6cff2dccb2..a2d99c49ac 100644 --- a/DuckDuckGo.xcodeproj/project.pbxproj +++ b/DuckDuckGo.xcodeproj/project.pbxproj @@ -12773,7 +12773,7 @@ repositoryURL = "https://github.com/duckduckgo/BrowserServicesKit"; requirement = { kind = revision; - revision = aa3c9acb1e5e3afd3b943e538868d61db19a9a8d; + revision = bfac1e6e02fe040d59d426dda45a2a3ce9eeb047; }; }; AA06B6B52672AF8100F541C5 /* XCRemoteSwiftPackageReference "Sparkle" */ = { diff --git a/DuckDuckGo.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved b/DuckDuckGo.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved index 6af271a881..a3cc5aabdc 100644 --- a/DuckDuckGo.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved +++ b/DuckDuckGo.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved @@ -14,7 +14,7 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/duckduckgo/BrowserServicesKit", "state" : { - "revision" : "aa3c9acb1e5e3afd3b943e538868d61db19a9a8d" + "revision" : "bfac1e6e02fe040d59d426dda45a2a3ce9eeb047" } }, { @@ -103,8 +103,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/apple/swift-argument-parser", "state" : { - "revision" : "8f4d2753f0e4778c76d5f05ad16c74f707390531", - "version" : "1.2.3" + "revision" : "c8ed701b513cf5177118a175d85fbbbcd707ab41", + "version" : "1.3.0" } }, { diff --git a/IntegrationTests/.swiftlint.yml b/IntegrationTests/.swiftlint.yml new file mode 100644 index 0000000000..bf8a5655d9 --- /dev/null +++ b/IntegrationTests/.swiftlint.yml @@ -0,0 +1,17 @@ +disabled_rules: + - file_length + - unused_closure_parameter + - type_name + - force_cast + - force_try + - function_body_length + - cyclomatic_complexity + - identifier_name + - blanket_disable_command + - type_body_length + - explicit_non_final_class + - enforce_os_log_wrapper + +large_tuple: + warning: 6 + error: 10 diff --git a/UITests/.swiftlint.yml b/UITests/.swiftlint.yml new file mode 100644 index 0000000000..bf8a5655d9 --- /dev/null +++ b/UITests/.swiftlint.yml @@ -0,0 +1,17 @@ +disabled_rules: + - file_length + - unused_closure_parameter + - type_name + - force_cast + - force_try + - function_body_length + - cyclomatic_complexity + - identifier_name + - blanket_disable_command + - type_body_length + - explicit_non_final_class + - enforce_os_log_wrapper + +large_tuple: + warning: 6 + error: 10 diff --git a/UnitTests/.swiftlint.yml b/UnitTests/.swiftlint.yml new file mode 100644 index 0000000000..bf8a5655d9 --- /dev/null +++ b/UnitTests/.swiftlint.yml @@ -0,0 +1,17 @@ +disabled_rules: + - file_length + - unused_closure_parameter + - type_name + - force_cast + - force_try + - function_body_length + - cyclomatic_complexity + - identifier_name + - blanket_disable_command + - type_body_length + - explicit_non_final_class + - enforce_os_log_wrapper + +large_tuple: + warning: 6 + error: 10 From 858ea60ebc1b25a55345d62c39f6c7d9c2cd276d Mon Sep 17 00:00:00 2001 From: Alexey Martemyanov Date: Thu, 7 Dec 2023 18:59:33 +0600 Subject: [PATCH 16/21] fix linter issues --- DuckDuckGo/Autoconsent/AutoconsentUserScript.swift | 2 +- DuckDuckGo/Autofill/ContentOverlayPopover.swift | 2 +- DuckDuckGo/Common/Extensions/URLExtension.swift | 2 +- DuckDuckGo/DBP/DBPHomeViewController.swift | 2 +- .../View/BrowserImportMoreInfoViewController.swift | 2 +- .../StateRestoration/StatePersistenceService.swift | 2 +- DuckDuckGo/Tab/UserScripts/UserScripts.swift | 2 +- DuckDuckGo/YoutubePlayer/DuckPlayerURLExtension.swift | 2 +- .../DataBrokerProtectionBackgroundManager.swift | 2 +- .../Sources/DataBrokerProtection/UI/UIMapper.swift | 10 +++++----- .../Subscription/DebugMenu/SubscriptionDebugMenu.swift | 2 +- .../Sources/SyncUI/Views/internal/QRCodeView.swift | 2 +- 12 files changed, 16 insertions(+), 16 deletions(-) diff --git a/DuckDuckGo/Autoconsent/AutoconsentUserScript.swift b/DuckDuckGo/Autoconsent/AutoconsentUserScript.swift index 3726bbb407..04fe422dab 100644 --- a/DuckDuckGo/Autoconsent/AutoconsentUserScript.swift +++ b/DuckDuckGo/Autoconsent/AutoconsentUserScript.swift @@ -401,7 +401,7 @@ extension AutoconsentUserScript { @MainActor func ensurePrompt(window: NSWindow, callback: @escaping (Bool) -> Void) { - let now = Date.init() + let now = Date() guard management.promptLastShown == nil || now > management.promptLastShown!.addingTimeInterval(30) else { // user said "not now" recently, don't bother asking os_log("Have a recent user response, canceling prompt", log: .autoconsent, type: .debug) diff --git a/DuckDuckGo/Autofill/ContentOverlayPopover.swift b/DuckDuckGo/Autofill/ContentOverlayPopover.swift index 89cdc475c4..d6d1bb1fc0 100644 --- a/DuckDuckGo/Autofill/ContentOverlayPopover.swift +++ b/DuckDuckGo/Autofill/ContentOverlayPopover.swift @@ -43,7 +43,7 @@ public final class ContentOverlayPopover { layer.masksToBounds = true layer.cornerRadius = 6 layer.borderWidth = 0.5 - layer.borderColor = CGColor.init(gray: 0, alpha: 0.3) // Looks a little lighter than 0.2 in the CSS + layer.borderColor = CGColor(gray: 0, alpha: 0.3) // Looks a little lighter than 0.2 in the CSS } viewController.view.window?.backgroundColor = .clear viewController.view.window?.acceptsMouseMovedEvents = true diff --git a/DuckDuckGo/Common/Extensions/URLExtension.swift b/DuckDuckGo/Common/Extensions/URLExtension.swift index a45fa1b7f7..2992f3d3a6 100644 --- a/DuckDuckGo/Common/Extensions/URLExtension.swift +++ b/DuckDuckGo/Common/Extensions/URLExtension.swift @@ -387,7 +387,7 @@ extension URL { func sanitizedForQuarantine() -> URL? { guard !self.isFileURL, !["data", "blob"].contains(self.scheme), - var components = URLComponents.init(url: self, resolvingAgainstBaseURL: false) + var components = URLComponents(url: self, resolvingAgainstBaseURL: false) else { return nil } diff --git a/DuckDuckGo/DBP/DBPHomeViewController.swift b/DuckDuckGo/DBP/DBPHomeViewController.swift index f7e7b76734..f33c061dce 100644 --- a/DuckDuckGo/DBP/DBPHomeViewController.swift +++ b/DuckDuckGo/DBP/DBPHomeViewController.swift @@ -46,7 +46,7 @@ final class DBPHomeViewController: NSViewController { let privacySettings = PrivacySecurityPreferences.shared let sessionKey = UUID().uuidString - let prefs = ContentScopeProperties.init(gpcEnabled: privacySettings.gpcEnabled, + let prefs = ContentScopeProperties(gpcEnabled: privacySettings.gpcEnabled, sessionKey: sessionKey, featureToggles: features) diff --git a/DuckDuckGo/DataImport/View/BrowserImportMoreInfoViewController.swift b/DuckDuckGo/DataImport/View/BrowserImportMoreInfoViewController.swift index 53374dc830..18263ab43c 100644 --- a/DuckDuckGo/DataImport/View/BrowserImportMoreInfoViewController.swift +++ b/DuckDuckGo/DataImport/View/BrowserImportMoreInfoViewController.swift @@ -29,7 +29,7 @@ final class BrowserImportMoreInfoViewController: NSViewController { let storyboard = NSStoryboard(name: Constants.storyboardName, bundle: nil) return storyboard.instantiateController(identifier: Constants.identifier) { (coder) -> Self? in - return Self.init(coder: coder, source: source) + return Self(coder: coder, source: source) } } diff --git a/DuckDuckGo/StateRestoration/StatePersistenceService.swift b/DuckDuckGo/StateRestoration/StatePersistenceService.swift index 8e7cd8cdd4..6aed78934a 100644 --- a/DuckDuckGo/StateRestoration/StatePersistenceService.swift +++ b/DuckDuckGo/StateRestoration/StatePersistenceService.swift @@ -105,7 +105,7 @@ final class StatePersistenceService { guard let data = fileStore.decrypt(archive) else { throw CocoaError(.fileReadNoSuchFile) } - let unarchiver = try NSKeyedUnarchiver.init(forReadingFrom: data) + let unarchiver = try NSKeyedUnarchiver(forReadingFrom: data) try restore(unarchiver) } diff --git a/DuckDuckGo/Tab/UserScripts/UserScripts.swift b/DuckDuckGo/Tab/UserScripts/UserScripts.swift index 0b801bd3e3..97611222d2 100644 --- a/DuckDuckGo/Tab/UserScripts/UserScripts.swift +++ b/DuckDuckGo/Tab/UserScripts/UserScripts.swift @@ -51,7 +51,7 @@ final class UserScripts: UserScriptsProvider { let privacySettings = PrivacySecurityPreferences.shared let privacyConfig = sourceProvider.privacyConfigurationManager.privacyConfig let sessionKey = sourceProvider.sessionKey ?? "" - let prefs = ContentScopeProperties.init(gpcEnabled: privacySettings.gpcEnabled, + let prefs = ContentScopeProperties(gpcEnabled: privacySettings.gpcEnabled, sessionKey: sessionKey, featureToggles: ContentScopeFeatureToggles.supportedFeaturesOnMacOS(privacyConfig)) contentScopeUserScript = ContentScopeUserScript(sourceProvider.privacyConfigurationManager, properties: prefs) diff --git a/DuckDuckGo/YoutubePlayer/DuckPlayerURLExtension.swift b/DuckDuckGo/YoutubePlayer/DuckPlayerURLExtension.swift index 0cbefc285f..abd7875078 100644 --- a/DuckDuckGo/YoutubePlayer/DuckPlayerURLExtension.swift +++ b/DuckDuckGo/YoutubePlayer/DuckPlayerURLExtension.swift @@ -142,7 +142,7 @@ extension URL { private func addingTimestamp(_ timestamp: String?) -> URL { guard let timestamp = timestamp, - let regex = try? NSRegularExpression.init(pattern: "^(\\d+[smh]?)+$"), + let regex = try? NSRegularExpression(pattern: "^(\\d+[smh]?)+$"), timestamp.matches(regex) else { return self diff --git a/DuckDuckGoDBPBackgroundAgent/DataBrokerProtectionBackgroundManager.swift b/DuckDuckGoDBPBackgroundAgent/DataBrokerProtectionBackgroundManager.swift index 6105595764..526288a62c 100644 --- a/DuckDuckGoDBPBackgroundAgent/DataBrokerProtectionBackgroundManager.swift +++ b/DuckDuckGoDBPBackgroundAgent/DataBrokerProtectionBackgroundManager.swift @@ -52,7 +52,7 @@ public final class DataBrokerProtectionBackgroundManager { thirdPartyCredentialsProvider: false) let sessionKey = UUID().uuidString - let prefs = ContentScopeProperties.init(gpcEnabled: false, + let prefs = ContentScopeProperties(gpcEnabled: false, sessionKey: sessionKey, featureToggles: features) diff --git a/LocalPackages/DataBrokerProtection/Sources/DataBrokerProtection/UI/UIMapper.swift b/LocalPackages/DataBrokerProtection/Sources/DataBrokerProtection/UI/UIMapper.swift index 44e2f2bc2a..08cbb09a9f 100644 --- a/LocalPackages/DataBrokerProtection/Sources/DataBrokerProtection/UI/UIMapper.swift +++ b/LocalPackages/DataBrokerProtection/Sources/DataBrokerProtection/UI/UIMapper.swift @@ -51,7 +51,7 @@ struct MapperToUI { func initialScanState(_ brokerProfileQueryData: [BrokerProfileQueryData]) -> DBPUIInitialScanState { // Total and current scans are misleading. The UI are counting this per broker and // not by the total real cans that the app is doing. - let profileQueriesGroupedByBroker = Dictionary.init(grouping: brokerProfileQueryData, by: { $0.dataBroker.name }) + let profileQueriesGroupedByBroker = Dictionary(grouping: brokerProfileQueryData, by: { $0.dataBroker.name }) let totalScans = profileQueriesGroupedByBroker.reduce(0) { accumulator, element in return accumulator + element.value.totalScans @@ -93,7 +93,7 @@ struct MapperToUI { var removedProfiles = [DBPUIDataBrokerProfileMatch]() let scansThatRanAtLeastOnce = brokerProfileQueryData.flatMap { $0.sitesScanned } - let sitesScanned = Dictionary.init(grouping: scansThatRanAtLeastOnce, by: { $0 }).count + let sitesScanned = Dictionary(grouping: scansThatRanAtLeastOnce, by: { $0 }).count brokerProfileQueryData.forEach { let dataBroker = $0.dataBroker @@ -123,7 +123,7 @@ struct MapperToUI { } } - let completedOptOutsDictionary = Dictionary.init(grouping: removedProfiles, by: { $0.dataBroker }) + let completedOptOutsDictionary = Dictionary(grouping: removedProfiles, by: { $0.dataBroker }) let completedOptOuts = completedOptOutsDictionary.map { (key: DBPUIDataBroker, value: [DBPUIDataBrokerProfileMatch]) in DBPUIOptOutMatch(dataBroker: key, matches: value.count) } @@ -141,7 +141,7 @@ struct MapperToUI { private func getLastScanInformation(brokerProfileQueryData: [BrokerProfileQueryData], currentDate: Date = Date(), format: String = "dd/MM/yyyy") -> DBUIScanDate { - let scansGroupedByLastRunDate = Dictionary.init(grouping: brokerProfileQueryData, by: { $0.scanOperationData.lastRunDate?.toFormat(format) }) + let scansGroupedByLastRunDate = Dictionary(grouping: brokerProfileQueryData, by: { $0.scanOperationData.lastRunDate?.toFormat(format) }) let closestScansBeforeToday = scansGroupedByLastRunDate .filter { $0.key != nil && $0.key!.toDate(using: format) < currentDate } .sorted { $0.key! < $1.key! } @@ -154,7 +154,7 @@ struct MapperToUI { private func getNextScansInformation(brokerProfileQueryData: [BrokerProfileQueryData], currentDate: Date = Date(), format: String = "dd/MM/yyyy") -> DBUIScanDate { - let scansGroupedByPreferredRunDate = Dictionary.init(grouping: brokerProfileQueryData, by: { $0.scanOperationData.preferredRunDate?.toFormat(format) }) + let scansGroupedByPreferredRunDate = Dictionary(grouping: brokerProfileQueryData, by: { $0.scanOperationData.preferredRunDate?.toFormat(format) }) let closestScansAfterToday = scansGroupedByPreferredRunDate .filter { $0.key != nil && $0.key!.toDate(using: format) > currentDate } .sorted { $0.key! < $1.key! } diff --git a/LocalPackages/Subscription/Sources/Subscription/DebugMenu/SubscriptionDebugMenu.swift b/LocalPackages/Subscription/Sources/Subscription/DebugMenu/SubscriptionDebugMenu.swift index ae2ddfe3ce..91a92d5c18 100644 --- a/LocalPackages/Subscription/Sources/Subscription/DebugMenu/SubscriptionDebugMenu.swift +++ b/LocalPackages/Subscription/Sources/Subscription/DebugMenu/SubscriptionDebugMenu.swift @@ -97,7 +97,7 @@ public final class SubscriptionDebugMenu: NSMenuItem { private func showAlert(title: String, message: String? = nil) { Task { @MainActor in - let alert = NSAlert.init() + let alert = NSAlert() alert.messageText = title if let message = message { alert.informativeText = message diff --git a/LocalPackages/SyncUI/Sources/SyncUI/Views/internal/QRCodeView.swift b/LocalPackages/SyncUI/Sources/SyncUI/Views/internal/QRCodeView.swift index fb6f3153fc..cf6627f750 100644 --- a/LocalPackages/SyncUI/Sources/SyncUI/Views/internal/QRCodeView.swift +++ b/LocalPackages/SyncUI/Sources/SyncUI/Views/internal/QRCodeView.swift @@ -40,7 +40,7 @@ struct QRCode: View { return NSImage(systemSymbolName: "xmark.circle", accessibilityDescription: nil) ?? NSImage() }() let data = Data(text.utf8) - let qrCodeFilter: CIFilter = CIFilter.init(name: "CIQRCodeGenerator")! + let qrCodeFilter: CIFilter = CIFilter(name: "CIQRCodeGenerator")! qrCodeFilter.setValue(data, forKey: "inputMessage") qrCodeFilter.setValue("H", forKey: "inputCorrectionLevel") From edfbdf277f644a7e67aa826172fe158410cbd51c Mon Sep 17 00:00:00 2001 From: Alexey Martemyanov Date: Mon, 18 Dec 2023 13:29:48 +0600 Subject: [PATCH 17/21] set BSK to 94.0.3 --- DuckDuckGo.xcodeproj/project.pbxproj | 4 ++-- .../project.xcworkspace/xcshareddata/swiftpm/Package.resolved | 3 ++- LocalPackages/Account/Package.swift | 2 +- LocalPackages/DataBrokerProtection/Package.swift | 2 +- LocalPackages/LoginItems/Package.swift | 2 +- LocalPackages/NetworkProtectionMac/Package.swift | 2 +- LocalPackages/PixelKit/Package.swift | 2 +- LocalPackages/Purchase/Package.swift | 2 +- LocalPackages/Subscription/Package.swift | 2 +- LocalPackages/SwiftUIExtensions/Package.swift | 2 +- LocalPackages/SyncUI/Package.swift | 2 +- LocalPackages/SystemExtensionManager/Package.swift | 2 +- LocalPackages/XPCHelper/Package.swift | 2 +- 13 files changed, 15 insertions(+), 14 deletions(-) diff --git a/DuckDuckGo.xcodeproj/project.pbxproj b/DuckDuckGo.xcodeproj/project.pbxproj index 6c4d21cac8..fd45278cee 100644 --- a/DuckDuckGo.xcodeproj/project.pbxproj +++ b/DuckDuckGo.xcodeproj/project.pbxproj @@ -12774,8 +12774,8 @@ isa = XCRemoteSwiftPackageReference; repositoryURL = "https://github.com/duckduckgo/BrowserServicesKit"; requirement = { - kind = revision; - revision = 3faf71bdc57d099b0c9704f98534cd1527bb903b; + kind = exactVersion; + version = 94.0.3; }; }; AA06B6B52672AF8100F541C5 /* XCRemoteSwiftPackageReference "Sparkle" */ = { diff --git a/DuckDuckGo.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved b/DuckDuckGo.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved index 639b6d89e1..e39bf94e1a 100644 --- a/DuckDuckGo.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved +++ b/DuckDuckGo.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved @@ -14,7 +14,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/duckduckgo/BrowserServicesKit", "state" : { - "revision" : "3faf71bdc57d099b0c9704f98534cd1527bb903b" + "revision" : "d07e18b3785d31c15364e56bdd2cb4b27edd35d0", + "version" : "94.0.3" } }, { diff --git a/LocalPackages/Account/Package.swift b/LocalPackages/Account/Package.swift index 8db56b4d9a..ac89713bde 100644 --- a/LocalPackages/Account/Package.swift +++ b/LocalPackages/Account/Package.swift @@ -12,7 +12,7 @@ let package = Package( targets: ["Account"]), ], dependencies: [ - .package(url: "https://github.com/duckduckgo/BrowserServicesKit", exact: "94.0.0"), + .package(url: "https://github.com/duckduckgo/BrowserServicesKit", exact: "94.0.3"), .package(path: "../Purchase") ], targets: [ diff --git a/LocalPackages/DataBrokerProtection/Package.swift b/LocalPackages/DataBrokerProtection/Package.swift index 477f90c1c6..4ae4836f76 100644 --- a/LocalPackages/DataBrokerProtection/Package.swift +++ b/LocalPackages/DataBrokerProtection/Package.swift @@ -29,7 +29,7 @@ let package = Package( targets: ["DataBrokerProtection"]) ], dependencies: [ - .package(url: "https://github.com/duckduckgo/BrowserServicesKit", exact: "94.0.0"), + .package(url: "https://github.com/duckduckgo/BrowserServicesKit", exact: "94.0.3"), .package(path: "../PixelKit"), .package(path: "../SwiftUIExtensions"), .package(path: "../XPCHelper") diff --git a/LocalPackages/LoginItems/Package.swift b/LocalPackages/LoginItems/Package.swift index 9aee9b8d7a..812799c709 100644 --- a/LocalPackages/LoginItems/Package.swift +++ b/LocalPackages/LoginItems/Package.swift @@ -13,7 +13,7 @@ let package = Package( ), ], dependencies: [ - .package(url: "https://github.com/duckduckgo/BrowserServicesKit", exact: "90.0.0"), + .package(url: "https://github.com/duckduckgo/BrowserServicesKit", exact: "94.0.3"), ], targets: [ .target( diff --git a/LocalPackages/NetworkProtectionMac/Package.swift b/LocalPackages/NetworkProtectionMac/Package.swift index 438bc7fbd4..8ca1026715 100644 --- a/LocalPackages/NetworkProtectionMac/Package.swift +++ b/LocalPackages/NetworkProtectionMac/Package.swift @@ -30,7 +30,7 @@ let package = Package( .library(name: "NetworkProtectionUI", targets: ["NetworkProtectionUI"]) ], dependencies: [ - .package(url: "https://github.com/duckduckgo/BrowserServicesKit", exact: "94.0.0"), + .package(url: "https://github.com/duckduckgo/BrowserServicesKit", exact: "94.0.3"), .package(path: "../XPCHelper"), .package(path: "../SwiftUIExtensions") ], diff --git a/LocalPackages/PixelKit/Package.swift b/LocalPackages/PixelKit/Package.swift index 76dcd70869..84d0ee7c05 100644 --- a/LocalPackages/PixelKit/Package.swift +++ b/LocalPackages/PixelKit/Package.swift @@ -20,7 +20,7 @@ let package = Package( ) ], dependencies: [ - .package(url: "https://github.com/duckduckgo/BrowserServicesKit", exact: "90.0.0"), + .package(url: "https://github.com/duckduckgo/BrowserServicesKit", exact: "94.0.3"), ], targets: [ .target( diff --git a/LocalPackages/Purchase/Package.swift b/LocalPackages/Purchase/Package.swift index 831317aeae..e285e512bf 100644 --- a/LocalPackages/Purchase/Package.swift +++ b/LocalPackages/Purchase/Package.swift @@ -13,7 +13,7 @@ let package = Package( ), ], dependencies: [ - .package(url: "https://github.com/duckduckgo/BrowserServicesKit", exact: "90.0.0"), + .package(url: "https://github.com/duckduckgo/BrowserServicesKit", exact: "94.0.3"), ], targets: [ .target( diff --git a/LocalPackages/Subscription/Package.swift b/LocalPackages/Subscription/Package.swift index aabd98c5de..c2128fc6bb 100644 --- a/LocalPackages/Subscription/Package.swift +++ b/LocalPackages/Subscription/Package.swift @@ -15,7 +15,7 @@ let package = Package( .package(path: "../Account"), .package(path: "../Purchase"), .package(path: "../SwiftUIExtensions"), - .package(url: "https://github.com/duckduckgo/BrowserServicesKit", exact: "90.0.0"), + .package(url: "https://github.com/duckduckgo/BrowserServicesKit", exact: "94.0.3"), ], targets: [ .target( diff --git a/LocalPackages/SwiftUIExtensions/Package.swift b/LocalPackages/SwiftUIExtensions/Package.swift index 74ac671569..39468594bf 100644 --- a/LocalPackages/SwiftUIExtensions/Package.swift +++ b/LocalPackages/SwiftUIExtensions/Package.swift @@ -13,7 +13,7 @@ let package = Package( ), ], dependencies: [ - .package(url: "https://github.com/duckduckgo/BrowserServicesKit", exact: "90.0.0"), + .package(url: "https://github.com/duckduckgo/BrowserServicesKit", exact: "94.0.3"), ], targets: [ .target( diff --git a/LocalPackages/SyncUI/Package.swift b/LocalPackages/SyncUI/Package.swift index d518f62a27..6b203f9013 100644 --- a/LocalPackages/SyncUI/Package.swift +++ b/LocalPackages/SyncUI/Package.swift @@ -13,7 +13,7 @@ let package = Package( ], dependencies: [ .package(path: "../SwiftUIExtensions"), - .package(url: "https://github.com/duckduckgo/BrowserServicesKit", exact: "90.0.0"), + .package(url: "https://github.com/duckduckgo/BrowserServicesKit", exact: "94.0.3"), ], targets: [ .target( diff --git a/LocalPackages/SystemExtensionManager/Package.swift b/LocalPackages/SystemExtensionManager/Package.swift index f0e1cb92b0..dad8deb3ce 100644 --- a/LocalPackages/SystemExtensionManager/Package.swift +++ b/LocalPackages/SystemExtensionManager/Package.swift @@ -16,7 +16,7 @@ let package = Package( ), ], dependencies: [ - .package(url: "https://github.com/duckduckgo/BrowserServicesKit", exact: "90.0.0"), + .package(url: "https://github.com/duckduckgo/BrowserServicesKit", exact: "94.0.3"), ], targets: [ // Targets are the basic building blocks of a package, defining a module or a test suite. diff --git a/LocalPackages/XPCHelper/Package.swift b/LocalPackages/XPCHelper/Package.swift index c6cfe8e98a..8fb7f222ba 100644 --- a/LocalPackages/XPCHelper/Package.swift +++ b/LocalPackages/XPCHelper/Package.swift @@ -30,7 +30,7 @@ let package = Package( .library(name: "XPCHelper", targets: ["XPCHelper"]), ], dependencies: [ - .package(url: "https://github.com/duckduckgo/BrowserServicesKit", exact: "90.0.0"), + .package(url: "https://github.com/duckduckgo/BrowserServicesKit", exact: "94.0.3"), ], targets: [ // Targets are the basic building blocks of a package. A target can define a module or a test suite. From 52703f3c9e7b478b81d6a42908abdd3a6b6359a9 Mon Sep 17 00:00:00 2001 From: Alexey Martemyanov Date: Mon, 18 Dec 2023 13:51:26 +0600 Subject: [PATCH 18/21] fix tests linter issues --- .../Bookmarks/Model/BookmarkNodeTests.swift | 2 +- .../Common/Extensions/HTTPCookieTests.swift | 2 +- .../Geolocation/CLLocationManagerMock.swift | 2 +- .../History/Services/HistoryStoringMock.swift | 1 + .../HomePage/ContinueSetUpModelTests.swift | 2 +- .../CapturingDefaultBrowserProvider.swift | 2 +- .../LocalPinningManagerTests.swift | 2 +- .../FireproofingReferenceTests.swift | 2 +- .../PasswordManagementListSectionTests.swift | 4 ---- .../PixelExperimentTests.swift | 2 +- .../TabBar/ViewModel/TabLazyLoaderTests.swift | 24 +++++++++---------- .../VPNFeedbackFormViewModelTests.swift | 3 --- .../Waitlist/WaitlistViewModelTests.swift | 8 +++---- 13 files changed, 25 insertions(+), 31 deletions(-) diff --git a/UnitTests/Bookmarks/Model/BookmarkNodeTests.swift b/UnitTests/Bookmarks/Model/BookmarkNodeTests.swift index 7290746122..8a9060c2f9 100644 --- a/UnitTests/Bookmarks/Model/BookmarkNodeTests.swift +++ b/UnitTests/Bookmarks/Model/BookmarkNodeTests.swift @@ -112,7 +112,7 @@ class BookmarkNodeTests: XCTestCase { let rootNode = BookmarkNode(representedObject: TestObject(), parent: nil) let indexPath = rootNode.indexPath - XCTAssertEqual(indexPath, IndexPath.init(index: 0)) + XCTAssertEqual(indexPath, IndexPath(index: 0)) } func testWhenGettingIndexPath_AndNodeIsChild_ThenChildIndexPathIsReturned() { diff --git a/UnitTests/Common/Extensions/HTTPCookieTests.swift b/UnitTests/Common/Extensions/HTTPCookieTests.swift index e781001670..e9865e64e7 100644 --- a/UnitTests/Common/Extensions/HTTPCookieTests.swift +++ b/UnitTests/Common/Extensions/HTTPCookieTests.swift @@ -23,7 +23,7 @@ class HTTPCookieTests: XCTestCase { func testCookieBelongsToETLDPlus1Domain() { // Case 1: Cookie domain and eTLD+1 domain are the same - var cookieProperties: [HTTPCookiePropertyKey : Any] = [ + var cookieProperties: [HTTPCookiePropertyKey: Any] = [ .domain: "example.com", .path: "/", .name: "TestCookie", diff --git a/UnitTests/Geolocation/CLLocationManagerMock.swift b/UnitTests/Geolocation/CLLocationManagerMock.swift index b110193dcc..bf61216d4f 100644 --- a/UnitTests/Geolocation/CLLocationManagerMock.swift +++ b/UnitTests/Geolocation/CLLocationManagerMock.swift @@ -46,7 +46,7 @@ final class CLLocationManagerMock: CLLocationManager { override init() { super.init() - selfRef = NSValue.init(nonretainedObject: self) + selfRef = NSValue(nonretainedObject: self) Self.instances.append(selfRef) } diff --git a/UnitTests/History/Services/HistoryStoringMock.swift b/UnitTests/History/Services/HistoryStoringMock.swift index 728a7cd082..8b98a3d1b9 100644 --- a/UnitTests/History/Services/HistoryStoringMock.swift +++ b/UnitTests/History/Services/HistoryStoringMock.swift @@ -76,6 +76,7 @@ final class HistoryStoringMock: HistoryStoring { saveCalled = true savedHistoryEntries.append(entry) for visit in entry.visits { + // swiftlint:disable:next legacy_random visit.identifier = URL(string: "x-coredata://FBEAB2C4-8C32-4F3F-B34F-B79F293CDADD/VisitManagedObject/\(arc4random())") } diff --git a/UnitTests/HomePage/ContinueSetUpModelTests.swift b/UnitTests/HomePage/ContinueSetUpModelTests.swift index d77780657f..5284c9d322 100644 --- a/UnitTests/HomePage/ContinueSetUpModelTests.swift +++ b/UnitTests/HomePage/ContinueSetUpModelTests.swift @@ -1,5 +1,5 @@ // -// SetUpModelTests.swift +// ContinueSetUpModelTests.swift // // Copyright © 2023 DuckDuckGo. All rights reserved. // diff --git a/UnitTests/HomePage/Mocks/CapturingDefaultBrowserProvider.swift b/UnitTests/HomePage/Mocks/CapturingDefaultBrowserProvider.swift index c04b91f017..9931c9de94 100644 --- a/UnitTests/HomePage/Mocks/CapturingDefaultBrowserProvider.swift +++ b/UnitTests/HomePage/Mocks/CapturingDefaultBrowserProvider.swift @@ -1,5 +1,5 @@ // -// File.swift +// CapturingDefaultBrowserProvider.swift // // Copyright © 2023 DuckDuckGo. All rights reserved. // diff --git a/UnitTests/NavigationBar/LocalPinningManagerTests.swift b/UnitTests/NavigationBar/LocalPinningManagerTests.swift index 5a9ba9dbd7..9c57966d62 100644 --- a/UnitTests/NavigationBar/LocalPinningManagerTests.swift +++ b/UnitTests/NavigationBar/LocalPinningManagerTests.swift @@ -1,5 +1,5 @@ // -// LocalPinningManager.swift +// LocalPinningManagerTests.swift // // Copyright © 2022 DuckDuckGo. All rights reserved. // diff --git a/UnitTests/PrivacyReferenceTests/FireproofingReferenceTests.swift b/UnitTests/PrivacyReferenceTests/FireproofingReferenceTests.swift index d84ce9e662..3f51d5d926 100644 --- a/UnitTests/PrivacyReferenceTests/FireproofingReferenceTests.swift +++ b/UnitTests/PrivacyReferenceTests/FireproofingReferenceTests.swift @@ -77,7 +77,7 @@ final class FireproofingReferenceTests: XCTestCase { return } - Task { @MainActor () -> Void in + Task { @MainActor in await dataStore.cookieStore?.setCookie(cookie) await webCacheManager.clear() diff --git a/UnitTests/SecureVault/PasswordManagementListSectionTests.swift b/UnitTests/SecureVault/PasswordManagementListSectionTests.swift index 3c48a31db6..d9163847b3 100644 --- a/UnitTests/SecureVault/PasswordManagementListSectionTests.swift +++ b/UnitTests/SecureVault/PasswordManagementListSectionTests.swift @@ -44,10 +44,6 @@ final class PasswordManagementListSectionTests: XCTestCase { login(named: "š") ] - override func setUp() { - super.setUp() - } - func testWhenSortingEmptyArray_ThenNoSectionsAreReturned() { let sections = PasswordManagementListSection.sections(with: [], by: \.id, order: .ascending) XCTAssertTrue(sections.isEmpty) diff --git a/UnitTests/Statistics/PixelExperiment/PixelExperimentTests.swift b/UnitTests/Statistics/PixelExperiment/PixelExperimentTests.swift index 17087494c3..e5ae9939a5 100644 --- a/UnitTests/Statistics/PixelExperiment/PixelExperimentTests.swift +++ b/UnitTests/Statistics/PixelExperiment/PixelExperimentTests.swift @@ -1,5 +1,5 @@ // -// PixelTests.swift +// PixelExperimentTests.swift // // Copyright © 2023 DuckDuckGo. All rights reserved. // diff --git a/UnitTests/TabBar/ViewModel/TabLazyLoaderTests.swift b/UnitTests/TabBar/ViewModel/TabLazyLoaderTests.swift index d3dcc9ab21..d4ea051d82 100644 --- a/UnitTests/TabBar/ViewModel/TabLazyLoaderTests.swift +++ b/UnitTests/TabBar/ViewModel/TabLazyLoaderTests.swift @@ -150,8 +150,8 @@ class TabLazyLoaderTests: XCTestCase { dataSource.tabs = [ .mockNotUrl, - TabMock.init(isUrl: true, reloadExpectation: reloadExpectation), - TabMock.init(isUrl: true, reloadExpectation: reloadExpectation) + TabMock(isUrl: true, reloadExpectation: reloadExpectation), + TabMock(isUrl: true, reloadExpectation: reloadExpectation) ] dataSource.selectedTab = dataSource.tabs.first @@ -177,8 +177,8 @@ class TabLazyLoaderTests: XCTestCase { dataSource.tabs = [ selectedUrlTab, - TabMock.init(isUrl: true, reloadExpectation: reloadExpectation), - TabMock.init(isUrl: true, reloadExpectation: reloadExpectation) + TabMock(isUrl: true, reloadExpectation: reloadExpectation), + TabMock(isUrl: true, reloadExpectation: reloadExpectation) ] dataSource.selectedTab = dataSource.tabs.first @@ -203,8 +203,8 @@ class TabLazyLoaderTests: XCTestCase { dataSource.tabs = [ .mockUrl, - TabMock.init(isUrl: true, reloadExpectation: reloadExpectation), - TabMock.init(isUrl: true, reloadExpectation: reloadExpectation) + TabMock(isUrl: true, reloadExpectation: reloadExpectation), + TabMock(isUrl: true, reloadExpectation: reloadExpectation) ] dataSource.selectedTab = dataSource.tabs.first @@ -228,7 +228,7 @@ class TabLazyLoaderTests: XCTestCase { dataSource.tabs = [.mockNotUrl] for _ in 0..<(2 * maxNumberOfLazyLoadedTabs) { - dataSource.tabs.append(TabMock.init(isUrl: true, reloadExpectation: reloadExpectation)) + dataSource.tabs.append(TabMock(isUrl: true, reloadExpectation: reloadExpectation)) } dataSource.selectedTab = dataSource.tabs.first @@ -254,11 +254,11 @@ class TabLazyLoaderTests: XCTestCase { dataSource.tabs = [ selectedUrlTab, - TabMock.init(isUrl: true, reloadExpectation: reloadExpectation), - TabMock.init(isUrl: true, reloadExpectation: reloadExpectation), - TabMock.init(isUrl: true, reloadExpectation: reloadExpectation), - TabMock.init(isUrl: true, reloadExpectation: reloadExpectation), - TabMock.init(isUrl: true, reloadExpectation: reloadExpectation) + TabMock(isUrl: true, reloadExpectation: reloadExpectation), + TabMock(isUrl: true, reloadExpectation: reloadExpectation), + TabMock(isUrl: true, reloadExpectation: reloadExpectation), + TabMock(isUrl: true, reloadExpectation: reloadExpectation), + TabMock(isUrl: true, reloadExpectation: reloadExpectation) ] dataSource.selectedTab = selectedUrlTab diff --git a/UnitTests/VPNFeedbackForm/VPNFeedbackFormViewModelTests.swift b/UnitTests/VPNFeedbackForm/VPNFeedbackFormViewModelTests.swift index e325cf4516..481742c4b6 100644 --- a/UnitTests/VPNFeedbackForm/VPNFeedbackFormViewModelTests.swift +++ b/UnitTests/VPNFeedbackForm/VPNFeedbackFormViewModelTests.swift @@ -26,7 +26,6 @@ final class VPNFeedbackFormViewModelTests: XCTestCase { func testWhenCreatingViewModel_ThenInitialStateIsFeedbackPending() throws { let collector = MockVPNMetadataCollector() let sender = MockVPNFeedbackSender() - let delegate = MockVPNFeedbackFormViewModelDelegate() let viewModel = VPNFeedbackFormViewModel(metadataCollector: collector, feedbackSender: sender) XCTAssertEqual(viewModel.viewState, .feedbackPending) @@ -36,7 +35,6 @@ final class VPNFeedbackFormViewModelTests: XCTestCase { func testWhenSendingFeedbackSucceeds_ThenFeedbackIsSent() async throws { let collector = MockVPNMetadataCollector() let sender = MockVPNFeedbackSender() - let delegate = MockVPNFeedbackFormViewModelDelegate() let viewModel = VPNFeedbackFormViewModel(metadataCollector: collector, feedbackSender: sender) let text = "Some feedback report text" viewModel.selectedFeedbackCategory = .unableToInstall @@ -52,7 +50,6 @@ final class VPNFeedbackFormViewModelTests: XCTestCase { func testWhenSendingFeedbackFails_ThenFeedbackIsNotSent() async throws { let collector = MockVPNMetadataCollector() let sender = MockVPNFeedbackSender() - let delegate = MockVPNFeedbackFormViewModelDelegate() let viewModel = VPNFeedbackFormViewModel(metadataCollector: collector, feedbackSender: sender) let text = "Some feedback report text" viewModel.selectedFeedbackCategory = .unableToInstall diff --git a/UnitTests/Waitlist/WaitlistViewModelTests.swift b/UnitTests/Waitlist/WaitlistViewModelTests.swift index 0f2ecdd9de..8c1319d92b 100644 --- a/UnitTests/Waitlist/WaitlistViewModelTests.swift +++ b/UnitTests/Waitlist/WaitlistViewModelTests.swift @@ -28,7 +28,7 @@ final class WaitlistViewModelTests: XCTestCase { @MainActor func testWhenTimestampIsNotPresent_ThenStateIsNotJoinedQueue() async { let request = MockWaitlistRequest.failure() - let storage = MockWaitlistStorage.init() + let storage = MockWaitlistStorage() let viewModel = WaitlistViewModel(waitlistRequest: request, waitlistStorage: storage, notificationService: MockNotificationService(), @@ -44,7 +44,7 @@ final class WaitlistViewModelTests: XCTestCase { @MainActor func testWhenTimestampIsPresentAndInviteCodeIsNil_ThenStateIsJoinedQueue() async { let request = MockWaitlistRequest.failure() - let storage = MockWaitlistStorage.init() + let storage = MockWaitlistStorage() storage.store(waitlistTimestamp: 12345) let notificationService = MockNotificationService(authorizationStatus: .authorized) @@ -63,7 +63,7 @@ final class WaitlistViewModelTests: XCTestCase { @MainActor func testWhenTimestampIsPresentAndInviteCodeIsPresent_ThenStateIsInvited() async { let request = MockWaitlistRequest.failure() - let storage = MockWaitlistStorage.init() + let storage = MockWaitlistStorage() storage.store(waitlistTimestamp: 12345) storage.store(waitlistToken: "token") storage.store(inviteCode: "ABCD1234") @@ -108,7 +108,7 @@ final class WaitlistViewModelTests: XCTestCase { @MainActor func testWhenAcceptingTermsAndConditions_ThenAuthTokenIsFetched_AndTermsAndConditionsAreMarkedAsAccepted() async { let request = MockWaitlistRequest.failure() - let storage = MockWaitlistStorage.init() + let storage = MockWaitlistStorage() storage.store(waitlistTimestamp: 12345) storage.store(waitlistToken: "token") storage.store(inviteCode: "ABCD1234") From 65aeefdbf1cd965bdfa4aa07b80e922ec6a52cb8 Mon Sep 17 00:00:00 2001 From: Alexey Martemyanov Date: Mon, 18 Dec 2023 13:57:36 +0600 Subject: [PATCH 19/21] fix linter issue --- .../SecurityTests/AddressBarSpoofingIntegrationTests.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/IntegrationTests/SecurityTests/AddressBarSpoofingIntegrationTests.swift b/IntegrationTests/SecurityTests/AddressBarSpoofingIntegrationTests.swift index 05ee4f9681..f0bba6cf98 100644 --- a/IntegrationTests/SecurityTests/AddressBarSpoofingIntegrationTests.swift +++ b/IntegrationTests/SecurityTests/AddressBarSpoofingIntegrationTests.swift @@ -1,5 +1,5 @@ // -// NavigationProtectionIntegrationTests.swift +// AddressBarSpoofingIntegrationTests.swift // // Copyright © 2023 DuckDuckGo. All rights reserved. // From 0163c6f1617f2275cab8ff88d2eb7afbe208f965 Mon Sep 17 00:00:00 2001 From: Alexey Martemyanov Date: Mon, 18 Dec 2023 13:57:47 +0600 Subject: [PATCH 20/21] fix ci checks --- .github/workflows/pr.yml | 3 +++ scripts/archive.sh | 2 ++ 2 files changed, 5 insertions(+) diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index c843038bdf..1e776878f9 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -133,6 +133,7 @@ jobs: -scheme "${{ matrix.scheme }}" \ -derivedDataPath "DerivedData" \ -configuration "CI" \ + -skipPackagePluginValidation \ ENABLE_TESTABILITY=true \ ONLY_ACTIVE_ARCH=${{ matrix.active-arch }} \ "-skip-testing:${{ matrix.integration-tests-target }}" \ @@ -146,6 +147,7 @@ jobs: -scheme "${{ matrix.scheme }}" \ -derivedDataPath "DerivedData" \ -configuration "CI" \ + -skipPackagePluginValidation \ ENABLE_TESTABILITY=true \ ONLY_ACTIVE_ARCH=${{ matrix.active-arch }} \ "-only-testing:${{ matrix.integration-tests-target }}" \ @@ -320,6 +322,7 @@ jobs: -scheme "${{ matrix.scheme }}" \ -derivedDataPath "DerivedData" \ -configuration "Release" \ + -skipPackagePluginValidation \ | tee release-xcodebuild.log \ | xcbeautify diff --git a/scripts/archive.sh b/scripts/archive.sh index b0e9b89e27..eacd115cb2 100755 --- a/scripts/archive.sh +++ b/scripts/archive.sh @@ -244,6 +244,7 @@ archive_and_export() { -configuration "${configuration}" \ -archivePath "${archive}" \ -derivedDataPath "${derived_data}" \ + -skipPackagePluginValidation \ MARKETING_VERSION="${app_version}" \ CURRENT_PROJECT_VERSION="${build_number}" \ RELEASE_PRODUCT_NAME_OVERRIDE=DuckDuckGo \ @@ -259,6 +260,7 @@ archive_and_export() { -exportPath "${workdir}" \ -exportOptionsPlist "${export_options_plist}" \ -configuration "${configuration}" \ + -skipPackagePluginValidation \ 2>&1 \ | ${log_formatter} } From fabd2ace07d47c177904e34829aeb25b5a49adaf Mon Sep 17 00:00:00 2001 From: Alexey Martemyanov Date: Mon, 18 Dec 2023 13:59:47 +0600 Subject: [PATCH 21/21] rollback unintended pbxproj change --- DuckDuckGo.xcodeproj/project.pbxproj | 4 ---- 1 file changed, 4 deletions(-) diff --git a/DuckDuckGo.xcodeproj/project.pbxproj b/DuckDuckGo.xcodeproj/project.pbxproj index cfea609986..6776156d71 100644 --- a/DuckDuckGo.xcodeproj/project.pbxproj +++ b/DuckDuckGo.xcodeproj/project.pbxproj @@ -12371,10 +12371,6 @@ isa = XCBuildConfiguration; baseConfigurationReference = 378B58CD295ECA75002C0CC0 /* DuckDuckGo.xcconfig */; buildSettings = { - CODE_SIGN_IDENTITY = "Apple Development"; - CODE_SIGN_STYLE = Automatic; - DEVELOPMENT_TEAM = HKE973VLUW; - PROVISIONING_PROFILE_SPECIFIER = ""; }; name = Debug; };