pumuki 6.3.172 → 6.3.173
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AGENTS.md +1 -16
- package/CHANGELOG.md +0 -101
- package/README.md +10 -14
- package/VERSION +1 -1
- package/core/facts/detectors/text/android.test.ts +0 -2827
- package/core/facts/detectors/text/android.ts +182 -5121
- package/core/facts/detectors/text/ios.test.ts +12 -290
- package/core/facts/detectors/text/ios.ts +28 -301
- package/core/facts/detectors/typescript/index.test.ts +139 -3733
- package/core/facts/detectors/typescript/index.ts +264 -4959
- package/core/facts/extractHeuristicFacts.ts +11 -328
- package/core/gate/evaluateRules.test.ts +0 -7
- package/core/gate/evaluateRules.ts +2 -1
- package/core/rules/presets/heuristics/android.test.ts +1 -399
- package/core/rules/presets/heuristics/android.ts +1 -1481
- package/core/rules/presets/heuristics/ios.test.ts +1 -11
- package/core/rules/presets/heuristics/ios.ts +0 -36
- package/core/rules/presets/heuristics/typescript.test.ts +2 -158
- package/core/rules/presets/heuristics/typescript.ts +0 -508
- package/core/rules/presets/iosEnterpriseRuleSet.test.ts +0 -5
- package/core/rules/presets/iosEnterpriseRuleSet.ts +5 -5
- package/docs/README.md +3 -3
- package/docs/operations/RELEASE_NOTES.md +1 -94
- package/docs/operations/framework-menu-consumer-walkthrough.md +15 -18
- package/docs/product/API_REFERENCE.md +1 -1
- package/docs/product/CONFIGURATION.md +0 -7
- package/docs/product/USAGE.md +1 -1
- package/docs/validation/README.md +1 -3
- package/docs/validation/ios-avdlee-parity-matrix.md +1 -1
- package/integrations/config/skillsCompilerTemplates.test.ts +0 -145
- package/integrations/config/skillsCompilerTemplates.ts +2 -1013
- package/integrations/config/skillsDetectorRegistry.ts +8 -523
- package/integrations/config/skillsMarkdownRules.ts +8 -1088
- package/integrations/config/skillsRuleSet.ts +3 -44
- package/integrations/evidence/buildEvidence.ts +5 -34
- package/integrations/evidence/platformSummary.test.ts +9 -73
- package/integrations/evidence/platformSummary.ts +7 -165
- package/integrations/evidence/repoState.ts +0 -3
- package/integrations/evidence/rulesCoverage.ts +0 -83
- package/integrations/evidence/schema.ts +0 -29
- package/integrations/evidence/writeEvidence.test.ts +0 -4
- package/integrations/evidence/writeEvidence.ts +2 -41
- package/integrations/gate/evaluateAiGate.ts +8 -312
- package/integrations/gate/remediationCatalog.ts +2 -20
- package/integrations/gate/stagePolicies.ts +18 -24
- package/integrations/git/astIntelligenceDualValidation.ts +2 -2
- package/integrations/git/gitAtomicity.ts +39 -284
- package/integrations/git/resolveGitRefs.ts +6 -35
- package/integrations/git/runPlatformGate.ts +143 -512
- package/integrations/git/runPlatformGateOutput.ts +8 -13
- package/integrations/git/stageRunners.ts +41 -26
- package/integrations/lifecycle/adapter.ts +0 -24
- package/integrations/lifecycle/audit.ts +16 -14
- package/integrations/lifecycle/cli.ts +20 -37
- package/integrations/lifecycle/cliSdd.ts +3 -4
- package/integrations/lifecycle/doctor.ts +1 -1
- package/integrations/lifecycle/packageInfo.ts +1 -118
- package/integrations/lifecycle/policyReconcile.ts +4 -27
- package/integrations/lifecycle/preWriteAutomation.ts +5 -5
- package/integrations/lifecycle/state.ts +1 -8
- package/integrations/lifecycle/watch.ts +8 -28
- package/integrations/mcp/aiGateCheck.ts +10 -194
- package/integrations/mcp/autoExecuteAiStart.ts +4 -7
- package/integrations/mcp/enterpriseServer.ts +3 -19
- package/integrations/mcp/preFlightCheck.ts +10 -89
- package/integrations/policy/gitAtomicityEnforcement.ts +2 -2
- package/integrations/policy/heuristicsEnforcement.ts +2 -2
- package/integrations/policy/policyProfiles.ts +18 -24
- package/integrations/policy/preWriteEnforcement.ts +1 -1
- package/integrations/policy/sddCompletenessEnforcement.ts +2 -2
- package/integrations/policy/skillsEnforcement.ts +47 -1
- package/integrations/policy/tddBddEnforcement.ts +2 -2
- package/integrations/sdd/evidenceScaffold.ts +8 -124
- package/integrations/tdd/contract.ts +0 -1
- package/integrations/tdd/enforcement.ts +0 -103
- package/integrations/tdd/types.ts +0 -6
- package/package.json +1 -1
- package/scripts/check-tracking-single-active.sh +1 -1
- package/scripts/framework-menu-advanced-view-lib.ts +0 -49
- package/scripts/framework-menu-consumer-actions-lib.ts +32 -32
- package/scripts/framework-menu-consumer-preflight-render.ts +0 -10
- package/scripts/framework-menu-consumer-preflight-run.ts +5 -31
- package/scripts/framework-menu-consumer-preflight-types.ts +0 -12
- package/scripts/framework-menu-consumer-runtime-actions.ts +5 -11
- package/scripts/framework-menu-consumer-runtime-audit.ts +28 -0
- package/scripts/framework-menu-consumer-runtime-evidence-classic.ts +42 -118
- package/scripts/framework-menu-consumer-runtime-lib.ts +0 -38
- package/scripts/framework-menu-consumer-runtime-menu.ts +15 -55
- package/scripts/framework-menu-consumer-runtime-types.ts +0 -4
- package/scripts/framework-menu-evidence-summary-read.ts +1 -17
- package/scripts/framework-menu-evidence-summary-types.ts +0 -3
- package/scripts/framework-menu-layout-data.ts +23 -3
- package/scripts/framework-menu-system-notifications-cause.ts +1 -24
- package/scripts/framework-menu-system-notifications-env.ts +0 -8
- package/scripts/framework-menu-system-notifications-gate.ts +2 -9
- package/scripts/framework-menu-system-notifications-macos-applescript-dialog.ts +1 -1
- package/scripts/framework-menu-system-notifications-macos-dialog-payload.ts +2 -14
- package/scripts/framework-menu-system-notifications-macos-swift-source.ts +1 -1
- package/scripts/framework-menu-system-notifications-payloads-blocked.ts +4 -128
- package/scripts/framework-menu-system-notifications-payloads.ts +1 -8
- package/scripts/framework-menu-system-notifications-remediation.ts +1 -15
- package/scripts/framework-menu-system-notifications-text.ts +1 -7
- package/scripts/framework-menu.ts +2 -37
- package/scripts/package-install-smoke-consumer-git-repo-lib.ts +1 -10
- package/scripts/package-install-smoke-consumer-npm-lib.ts +9 -46
- package/skills.lock.json +1244 -807
- package/integrations/evidence/trackingContract.ts +0 -17
- package/integrations/gate/blockingCause.ts +0 -40
- package/integrations/gate/governanceActionCatalog.ts +0 -296
- package/integrations/gate/runPlatformGateConfig.ts +0 -55
- package/integrations/gate/runPlatformGateDefaults.ts +0 -19
- package/integrations/lifecycle/bootstrapManifest.ts +0 -248
- package/integrations/lifecycle/cliGovernanceConsole.ts +0 -69
- package/integrations/lifecycle/governanceNextAction.ts +0 -181
- package/integrations/lifecycle/governanceObservationSnapshot.ts +0 -376
- package/integrations/lifecycle/trackingState.ts +0 -403
- package/integrations/mcp/alignedPlatformGate.ts +0 -248
- package/integrations/mcp/readMcpPrePushStdin.ts +0 -7
- package/scripts/build-ruralgo-s1-evidence-pack.ts +0 -85
- package/scripts/ruralgo-s1-evidence-pack-lib.ts +0 -200
|
@@ -6,14 +6,12 @@ import {
|
|
|
6
6
|
findSwiftOpenClosedSwitchMatch,
|
|
7
7
|
findSwiftConcreteDependencyDipMatch,
|
|
8
8
|
findSwiftPresentationSrpMatch,
|
|
9
|
-
findSwiftXCTestSrpMatch,
|
|
10
9
|
hasSwiftAnyViewUsage,
|
|
11
10
|
hasSwiftCallbackStyleSignature,
|
|
12
11
|
hasSwiftCornerRadiusUsage,
|
|
13
12
|
hasSwiftDispatchGroupUsage,
|
|
14
13
|
hasSwiftDispatchQueueUsage,
|
|
15
14
|
hasSwiftDispatchSemaphoreUsage,
|
|
16
|
-
hasSwiftExplicitColorStaticMemberUsage,
|
|
17
15
|
hasSwiftForEachIndicesUsage,
|
|
18
16
|
hasSwiftForceCastUsage,
|
|
19
17
|
hasSwiftFontWeightBoldUsage,
|
|
@@ -21,7 +19,6 @@ import {
|
|
|
21
19
|
hasSwiftForceTryUsage,
|
|
22
20
|
hasSwiftForceUnwrap,
|
|
23
21
|
hasSwiftGeometryReaderUsage,
|
|
24
|
-
hasSwiftInlineFilteringInForEachUsage,
|
|
25
22
|
hasSwiftLegacyOnChangeUsage,
|
|
26
23
|
hasSwiftLegacyExpectationDescriptionUsage,
|
|
27
24
|
hasSwiftLegacySwiftUiObservableWrapperUsage,
|
|
@@ -40,7 +37,6 @@ import {
|
|
|
40
37
|
hasSwiftOperationQueueUsage,
|
|
41
38
|
hasSwiftContainsUserFilterUsage,
|
|
42
39
|
hasSwiftPassedValueStateWrapperUsage,
|
|
43
|
-
hasSwiftStateWrapperWithoutPrivateUsage,
|
|
44
40
|
hasSwiftPreconcurrencyUsage,
|
|
45
41
|
hasSwiftSheetIsPresentedUsage,
|
|
46
42
|
hasSwiftScrollViewShowsIndicatorsUsage,
|
|
@@ -245,9 +241,7 @@ MainActor.assumeIsolated { reload() }
|
|
|
245
241
|
assert.equal(hasSwiftNonisolatedUnsafeUsage(source), true);
|
|
246
242
|
assert.equal(hasSwiftAssumeIsolatedUsage(source), true);
|
|
247
243
|
assert.equal(hasSwiftForEachIndicesUsage(source), true);
|
|
248
|
-
assert.equal(hasSwiftInlineFilteringInForEachUsage('ForEach(items.filter { $0.isActive }) { item in Text(item.title) }'), true);
|
|
249
244
|
assert.equal(hasSwiftContainsUserFilterUsage(source), true);
|
|
250
|
-
assert.equal(hasSwiftExplicitColorStaticMemberUsage('Text("A").foregroundStyle(Color.blue)'), true);
|
|
251
245
|
assert.equal(hasSwiftGeometryReaderUsage(source), true);
|
|
252
246
|
assert.equal(hasSwiftFontWeightBoldUsage(source), true);
|
|
253
247
|
assert.equal(hasSwiftObservableObjectUsage(source), true);
|
|
@@ -293,9 +287,7 @@ let t = "MainActor.assumeIsolated { reload() }"
|
|
|
293
287
|
assert.equal(hasSwiftNonisolatedUnsafeUsage(source), false);
|
|
294
288
|
assert.equal(hasSwiftAssumeIsolatedUsage(source), false);
|
|
295
289
|
assert.equal(hasSwiftForEachIndicesUsage(source), false);
|
|
296
|
-
assert.equal(hasSwiftInlineFilteringInForEachUsage(source), false);
|
|
297
290
|
assert.equal(hasSwiftContainsUserFilterUsage(source), false);
|
|
298
|
-
assert.equal(hasSwiftExplicitColorStaticMemberUsage('Text("A").foregroundStyle(.blue)'), false);
|
|
299
291
|
assert.equal(hasSwiftGeometryReaderUsage(source), false);
|
|
300
292
|
assert.equal(hasSwiftFontWeightBoldUsage(source), false);
|
|
301
293
|
assert.equal(hasSwiftTaskDetachedUsage(source), false);
|
|
@@ -382,34 +374,11 @@ final class SyncTests: XCTestCase {
|
|
|
382
374
|
}
|
|
383
375
|
}
|
|
384
376
|
}
|
|
385
|
-
`;
|
|
386
|
-
const brownfieldCompatibleUnitTest = `
|
|
387
|
-
import XCTest
|
|
388
|
-
|
|
389
|
-
final class LoginModelTests: XCTestCase {
|
|
390
|
-
func test_submit_validCredentials_storesSession() async throws {
|
|
391
|
-
let (sut, repository) = makeSUT()
|
|
392
|
-
try await sut.submit()
|
|
393
|
-
XCTAssertEqual(repository.receivedRequests.count, 1)
|
|
394
|
-
}
|
|
395
|
-
|
|
396
|
-
private func makeSUT(
|
|
397
|
-
file: StaticString = #filePath,
|
|
398
|
-
line: UInt = #line
|
|
399
|
-
) -> (LoginModel, AuthRepositorySpy) {
|
|
400
|
-
let repository = AuthRepositorySpy()
|
|
401
|
-
let sut = LoginModel(repository: repository)
|
|
402
|
-
trackForMemoryLeaks(sut, testCase: self, file: file, line: line)
|
|
403
|
-
trackForMemoryLeaks(repository, testCase: self, file: file, line: line)
|
|
404
|
-
return (sut, repository)
|
|
405
|
-
}
|
|
406
|
-
}
|
|
407
377
|
`;
|
|
408
378
|
|
|
409
|
-
assert.equal(hasSwiftLegacyXCTestImportUsage(unitTest),
|
|
379
|
+
assert.equal(hasSwiftLegacyXCTestImportUsage(unitTest), true);
|
|
410
380
|
assert.equal(hasSwiftLegacyXCTestImportUsage(uiTest), false);
|
|
411
381
|
assert.equal(hasSwiftLegacyXCTestImportUsage(performanceTest), false);
|
|
412
|
-
assert.equal(hasSwiftLegacyXCTestImportUsage(brownfieldCompatibleUnitTest), false);
|
|
413
382
|
});
|
|
414
383
|
|
|
415
384
|
test('hasSwiftLegacySwiftUiObservableWrapperUsage detecta @StateObject/@ObservedObject legacy', () => {
|
|
@@ -456,24 +425,6 @@ struct DetailView: View {
|
|
|
456
425
|
assert.equal(hasSwiftPassedValueStateWrapperUsage(validOwnership), false);
|
|
457
426
|
});
|
|
458
427
|
|
|
459
|
-
test('hasSwiftStateWrapperWithoutPrivateUsage detecta @State y @StateObject sin private en SwiftUI Views', () => {
|
|
460
|
-
const positive = `
|
|
461
|
-
struct DetailView: View {
|
|
462
|
-
@State var filter: String = ""
|
|
463
|
-
@StateObject var viewModel = DetailViewModel()
|
|
464
|
-
}
|
|
465
|
-
`;
|
|
466
|
-
const negative = `
|
|
467
|
-
struct DetailView: View {
|
|
468
|
-
@State private var filter: String = ""
|
|
469
|
-
@StateObject private var viewModel = DetailViewModel()
|
|
470
|
-
}
|
|
471
|
-
`;
|
|
472
|
-
|
|
473
|
-
assert.equal(hasSwiftStateWrapperWithoutPrivateUsage(positive), true);
|
|
474
|
-
assert.equal(hasSwiftStateWrapperWithoutPrivateUsage(negative), false);
|
|
475
|
-
});
|
|
476
|
-
|
|
477
428
|
test('hasSwiftModernizableXCTestSuiteUsage detecta suites legacy y excluye mixed/UI', () => {
|
|
478
429
|
const legacySuite = `
|
|
479
430
|
import XCTest
|
|
@@ -507,33 +458,10 @@ final class LoginUITests: XCTestCase {
|
|
|
507
458
|
}
|
|
508
459
|
}
|
|
509
460
|
`;
|
|
510
|
-
const brownfieldCompatibleSuite = `
|
|
511
|
-
import XCTest
|
|
512
|
-
|
|
513
|
-
final class LoginModelTests: XCTestCase {
|
|
514
|
-
func test_submit_validCredentials_storesSession() async throws {
|
|
515
|
-
let (sut, repository) = makeSUT()
|
|
516
|
-
try await sut.submit()
|
|
517
|
-
XCTAssertEqual(repository.receivedRequests.count, 1)
|
|
518
|
-
}
|
|
519
461
|
|
|
520
|
-
|
|
521
|
-
file: StaticString = #filePath,
|
|
522
|
-
line: UInt = #line
|
|
523
|
-
) -> (LoginModel, AuthRepositorySpy) {
|
|
524
|
-
let repository = AuthRepositorySpy()
|
|
525
|
-
let sut = LoginModel(repository: repository)
|
|
526
|
-
trackForMemoryLeaks(sut, testCase: self, file: file, line: line)
|
|
527
|
-
trackForMemoryLeaks(repository, testCase: self, file: file, line: line)
|
|
528
|
-
return (sut, repository)
|
|
529
|
-
}
|
|
530
|
-
}
|
|
531
|
-
`;
|
|
532
|
-
|
|
533
|
-
assert.equal(hasSwiftModernizableXCTestSuiteUsage(legacySuite), false);
|
|
462
|
+
assert.equal(hasSwiftModernizableXCTestSuiteUsage(legacySuite), true);
|
|
534
463
|
assert.equal(hasSwiftModernizableXCTestSuiteUsage(mixedSuite), false);
|
|
535
464
|
assert.equal(hasSwiftModernizableXCTestSuiteUsage(uiSuite), false);
|
|
536
|
-
assert.equal(hasSwiftModernizableXCTestSuiteUsage(brownfieldCompatibleSuite), false);
|
|
537
465
|
});
|
|
538
466
|
|
|
539
467
|
test('hasSwiftMixedTestingFrameworksUsage detecta mezcla XCTestCase y Testing/@Test', () => {
|
|
@@ -564,34 +492,11 @@ import Testing
|
|
|
564
492
|
struct LoginModernTests {
|
|
565
493
|
@Test func login() async {}
|
|
566
494
|
}
|
|
567
|
-
`;
|
|
568
|
-
const mixedWithReexportedTesting = `
|
|
569
|
-
import XCTest
|
|
570
|
-
|
|
571
|
-
final class LoginTests: XCTestCase {
|
|
572
|
-
func testLegacyLogin() {}
|
|
573
|
-
}
|
|
574
|
-
|
|
575
|
-
struct LoginModernTests {
|
|
576
|
-
@Test func login() async {}
|
|
577
|
-
}
|
|
578
|
-
`;
|
|
579
|
-
const ignoredCommentsAndStrings = `
|
|
580
|
-
import XCTest
|
|
581
|
-
|
|
582
|
-
final class LoginTests: XCTestCase {
|
|
583
|
-
func testLegacyLogin() {
|
|
584
|
-
let text = "@Test func login() async {}"
|
|
585
|
-
// @Suite
|
|
586
|
-
}
|
|
587
|
-
}
|
|
588
495
|
`;
|
|
589
496
|
|
|
590
497
|
assert.equal(hasSwiftMixedTestingFrameworksUsage(mixedSuite), true);
|
|
591
|
-
assert.equal(hasSwiftMixedTestingFrameworksUsage(mixedWithReexportedTesting), true);
|
|
592
498
|
assert.equal(hasSwiftMixedTestingFrameworksUsage(legacyOnly), false);
|
|
593
499
|
assert.equal(hasSwiftMixedTestingFrameworksUsage(modernOnly), false);
|
|
594
|
-
assert.equal(hasSwiftMixedTestingFrameworksUsage(ignoredCommentsAndStrings), false);
|
|
595
500
|
});
|
|
596
501
|
|
|
597
502
|
test('hasSwiftXCTestAssertionUsage detecta XCTAssert y XCTFail reales', () => {
|
|
@@ -608,87 +513,6 @@ let text = "XCTAssertEqual(value, expected)"
|
|
|
608
513
|
assert.equal(hasSwiftXCTestAssertionUsage(ignored), false);
|
|
609
514
|
});
|
|
610
515
|
|
|
611
|
-
test('hasSwiftXCTestAssertionUsage excluye XCTest compatible con UI automation', () => {
|
|
612
|
-
const uiSource = `
|
|
613
|
-
import XCTest
|
|
614
|
-
|
|
615
|
-
final class BuyerCommerceUISmokeTests: XCTestCase {
|
|
616
|
-
func test_buyer_flow() {
|
|
617
|
-
let app = XCUIApplication()
|
|
618
|
-
app.launch()
|
|
619
|
-
XCTAssertTrue(app.buttons["Comprar"].exists)
|
|
620
|
-
}
|
|
621
|
-
}
|
|
622
|
-
`;
|
|
623
|
-
|
|
624
|
-
assert.equal(hasSwiftXCTestAssertionUsage(uiSource), false);
|
|
625
|
-
assert.equal(hasSwiftXCTUnwrapUsage(`${uiSource}\nlet value = try XCTUnwrap(optional)`), false);
|
|
626
|
-
});
|
|
627
|
-
|
|
628
|
-
test('detectores Swift Testing excluyen XCTest brownfield y dejan la calidad a su guard dedicado', () => {
|
|
629
|
-
const compatibleSource = `
|
|
630
|
-
import XCTest
|
|
631
|
-
|
|
632
|
-
final class LoginModelTests: XCTestCase {
|
|
633
|
-
func test_submit_validCredentials_storesSession() async throws {
|
|
634
|
-
let (sut, repository) = makeSUT()
|
|
635
|
-
try await sut.submit()
|
|
636
|
-
XCTAssertEqual(repository.receivedRequests.count, 1)
|
|
637
|
-
let session = try XCTUnwrap(repository.savedSession)
|
|
638
|
-
XCTAssertEqual(session.userId, "buyer-1")
|
|
639
|
-
}
|
|
640
|
-
|
|
641
|
-
private func makeSUT(
|
|
642
|
-
file: StaticString = #filePath,
|
|
643
|
-
line: UInt = #line
|
|
644
|
-
) -> (LoginModel, AuthRepositorySpy) {
|
|
645
|
-
let repository = AuthRepositorySpy()
|
|
646
|
-
let sut = LoginModel(repository: repository)
|
|
647
|
-
trackForMemoryLeaks(sut, testCase: self, file: file, line: line)
|
|
648
|
-
trackForMemoryLeaks(repository, testCase: self, file: file, line: line)
|
|
649
|
-
return (sut, repository)
|
|
650
|
-
}
|
|
651
|
-
}
|
|
652
|
-
`;
|
|
653
|
-
const missingQualityContract = `
|
|
654
|
-
import XCTest
|
|
655
|
-
|
|
656
|
-
final class LoginModelTests: XCTestCase {
|
|
657
|
-
func test_submit_validCredentials_storesSession() async throws {
|
|
658
|
-
XCTAssertEqual(repository.receivedRequests.count, 1)
|
|
659
|
-
}
|
|
660
|
-
}
|
|
661
|
-
`;
|
|
662
|
-
|
|
663
|
-
assert.equal(hasSwiftXCTestAssertionUsage(compatibleSource), false);
|
|
664
|
-
assert.equal(hasSwiftXCTUnwrapUsage(compatibleSource), false);
|
|
665
|
-
assert.equal(hasSwiftLegacyXCTestImportUsage(compatibleSource), false);
|
|
666
|
-
assert.equal(hasSwiftModernizableXCTestSuiteUsage(compatibleSource), false);
|
|
667
|
-
assert.equal(hasSwiftXCTestAssertionUsage(missingQualityContract), false);
|
|
668
|
-
assert.equal(hasSwiftLegacyXCTestImportUsage(missingQualityContract), false);
|
|
669
|
-
assert.equal(hasSwiftModernizableXCTestSuiteUsage(missingQualityContract), false);
|
|
670
|
-
});
|
|
671
|
-
|
|
672
|
-
test('detectores Swift Testing excluyen helpers y factories XCTest brownfield sin XCTestCase', () => {
|
|
673
|
-
const helperSource = `
|
|
674
|
-
import XCTest
|
|
675
|
-
|
|
676
|
-
final class AuthTestFactories {
|
|
677
|
-
static func makeToken() -> String {
|
|
678
|
-
"token"
|
|
679
|
-
}
|
|
680
|
-
}
|
|
681
|
-
|
|
682
|
-
func trackForMemoryLeaks(_ instance: AnyObject, file: StaticString = #filePath, line: UInt = #line) {
|
|
683
|
-
addTeardownBlock { _ = instance }
|
|
684
|
-
}
|
|
685
|
-
`;
|
|
686
|
-
|
|
687
|
-
assert.equal(hasSwiftLegacyXCTestImportUsage(helperSource), false);
|
|
688
|
-
assert.equal(hasSwiftModernizableXCTestSuiteUsage(helperSource), false);
|
|
689
|
-
assert.equal(hasSwiftXCTestAssertionUsage(helperSource), false);
|
|
690
|
-
});
|
|
691
|
-
|
|
692
516
|
test('hasSwiftXCTUnwrapUsage detecta XCTUnwrap real y evita strings', () => {
|
|
693
517
|
const source = `
|
|
694
518
|
let value = try XCTUnwrap(optionalValue)
|
|
@@ -702,84 +526,51 @@ let text = "XCTUnwrap(optionalValue)"
|
|
|
702
526
|
});
|
|
703
527
|
|
|
704
528
|
test('hasSwiftWaitForExpectationsUsage detecta waits legacy y excluye await fulfillment', () => {
|
|
705
|
-
const
|
|
706
|
-
func testLegacyAsync() async {
|
|
529
|
+
const legacyWait = `
|
|
707
530
|
let expectation = expectation(description: "Done")
|
|
708
531
|
wait(for: [expectation], timeout: 1)
|
|
709
532
|
waitForExpectations(timeout: 1)
|
|
710
|
-
}
|
|
711
|
-
`;
|
|
712
|
-
const legacySyncWait = `
|
|
713
|
-
func testLegacySync() {
|
|
714
|
-
let expectation = expectation(description: "Done")
|
|
715
|
-
wait(for: [expectation], timeout: 1)
|
|
716
|
-
}
|
|
717
533
|
`;
|
|
718
534
|
const modernWait = `
|
|
719
|
-
func testModernAsync() async {
|
|
720
535
|
let expectation = expectation(description: "Done")
|
|
721
536
|
await fulfillment(of: [expectation], timeout: 1)
|
|
722
|
-
}
|
|
723
537
|
`;
|
|
724
538
|
|
|
725
|
-
assert.equal(hasSwiftWaitForExpectationsUsage(
|
|
726
|
-
assert.equal(hasSwiftWaitForExpectationsUsage(legacySyncWait), false);
|
|
539
|
+
assert.equal(hasSwiftWaitForExpectationsUsage(legacyWait), true);
|
|
727
540
|
assert.equal(hasSwiftWaitForExpectationsUsage(modernWait), false);
|
|
728
541
|
});
|
|
729
542
|
|
|
730
|
-
test('hasSwiftLegacyExpectationDescriptionUsage detecta expectation(description:)
|
|
731
|
-
const
|
|
732
|
-
func testLegacyAsync() async {
|
|
733
|
-
let expectation = expectation(description: "Done")
|
|
734
|
-
doWork { expectation.fulfill() }
|
|
735
|
-
}
|
|
736
|
-
`;
|
|
737
|
-
const legacySyncExpectation = `
|
|
738
|
-
func testLegacySync() {
|
|
543
|
+
test('hasSwiftLegacyExpectationDescriptionUsage detecta expectation(description:) sin flujo moderno', () => {
|
|
544
|
+
const legacyExpectation = `
|
|
739
545
|
let expectation = expectation(description: "Done")
|
|
740
546
|
doWork { expectation.fulfill() }
|
|
741
|
-
|
|
547
|
+
waitForExpectations(timeout: 1)
|
|
742
548
|
`;
|
|
743
|
-
const
|
|
744
|
-
func testModernAsync() async {
|
|
549
|
+
const modernExpectation = `
|
|
745
550
|
let expectation = expectation(description: "Done")
|
|
746
551
|
doWork { expectation.fulfill() }
|
|
747
552
|
await fulfillment(of: [expectation], timeout: 1)
|
|
748
|
-
}
|
|
749
553
|
`;
|
|
750
|
-
const
|
|
751
|
-
func testConfirmation() async {
|
|
554
|
+
const confirmationOnly = `
|
|
752
555
|
await confirmation("Done") { confirm in
|
|
753
556
|
await doWork { confirm() }
|
|
754
557
|
}
|
|
755
|
-
}
|
|
756
|
-
`;
|
|
757
|
-
const commentedExpectation = `
|
|
758
|
-
func testModernAsync() async {
|
|
759
|
-
// let expectation = expectation(description: "Done")
|
|
760
|
-
await confirmation("Done") { confirm in confirm() }
|
|
761
|
-
}
|
|
762
558
|
`;
|
|
763
559
|
|
|
764
|
-
assert.equal(hasSwiftLegacyExpectationDescriptionUsage(
|
|
765
|
-
assert.equal(hasSwiftLegacyExpectationDescriptionUsage(
|
|
766
|
-
assert.equal(hasSwiftLegacyExpectationDescriptionUsage(
|
|
767
|
-
assert.equal(hasSwiftLegacyExpectationDescriptionUsage(confirmationFlow), false);
|
|
768
|
-
assert.equal(hasSwiftLegacyExpectationDescriptionUsage(commentedExpectation), false);
|
|
560
|
+
assert.equal(hasSwiftLegacyExpectationDescriptionUsage(legacyExpectation), true);
|
|
561
|
+
assert.equal(hasSwiftLegacyExpectationDescriptionUsage(modernExpectation), false);
|
|
562
|
+
assert.equal(hasSwiftLegacyExpectationDescriptionUsage(confirmationOnly), false);
|
|
769
563
|
});
|
|
770
564
|
|
|
771
565
|
test('hasSwiftNSManagedObjectBoundaryUsage detecta boundaries con NSManagedObject y excluye IDs o subclases', () => {
|
|
772
566
|
const source = `
|
|
773
567
|
func persist(_ entity: NSManagedObject) {}
|
|
774
568
|
var selectedEntity: NSManagedObject?
|
|
775
|
-
let cachedEntities: Result<[NSManagedObject], Error>
|
|
776
569
|
`;
|
|
777
570
|
const ignored = `
|
|
778
571
|
final class TodoEntity: NSManagedObject {}
|
|
779
572
|
var selectedID: NSManagedObjectID?
|
|
780
573
|
let context: NSManagedObjectContext
|
|
781
|
-
let text = "var selectedEntity: NSManagedObject?"
|
|
782
|
-
// func persist(_ entity: NSManagedObject) {}
|
|
783
574
|
`;
|
|
784
575
|
|
|
785
576
|
assert.equal(hasSwiftNSManagedObjectBoundaryUsage(source), true);
|
|
@@ -791,17 +582,11 @@ test('hasSwiftNSManagedObjectAsyncBoundaryUsage detecta async APIs con NSManaged
|
|
|
791
582
|
func fetchEntity() async throws -> NSManagedObject {
|
|
792
583
|
fatalError()
|
|
793
584
|
}
|
|
794
|
-
func fetchEntities() async throws -> Result<[NSManagedObject], Error> {
|
|
795
|
-
fatalError()
|
|
796
|
-
}
|
|
797
585
|
`;
|
|
798
586
|
const ignored = `
|
|
799
587
|
func fetchEntityID() async throws -> NSManagedObjectID {
|
|
800
588
|
fatalError()
|
|
801
589
|
}
|
|
802
|
-
func fetchContext() async throws -> NSManagedObjectContext {
|
|
803
|
-
fatalError()
|
|
804
|
-
}
|
|
805
590
|
`;
|
|
806
591
|
|
|
807
592
|
assert.equal(hasSwiftNSManagedObjectAsyncBoundaryUsage(source), true);
|
|
@@ -981,69 +766,6 @@ final class PumukiOcpIosCanaryUseCase {
|
|
|
981
766
|
assert.match(match.expected_fix, /estrategia|protocolo|registry/i);
|
|
982
767
|
});
|
|
983
768
|
|
|
984
|
-
test('findSwiftOpenClosedSwitchMatch detecta switch sobre outcome en Coordinator iOS', () => {
|
|
985
|
-
const source = `public final class LaunchFlowCoordinator {
|
|
986
|
-
public func bootstrap() async {
|
|
987
|
-
let outcome = await appConfigurationUseCase.execute()
|
|
988
|
-
switch outcome {
|
|
989
|
-
case .mandatoryUpdate:
|
|
990
|
-
route = .updateRequired
|
|
991
|
-
case .maintenance:
|
|
992
|
-
route = .maintenance
|
|
993
|
-
case .proceed:
|
|
994
|
-
route = .home
|
|
995
|
-
}
|
|
996
|
-
}
|
|
997
|
-
}
|
|
998
|
-
`;
|
|
999
|
-
|
|
1000
|
-
const match = findSwiftOpenClosedSwitchMatch(source);
|
|
1001
|
-
|
|
1002
|
-
assert.ok(match);
|
|
1003
|
-
assert.equal(match.primary_node.name, 'LaunchFlowCoordinator');
|
|
1004
|
-
assert.deepEqual(match.related_nodes, [
|
|
1005
|
-
{ kind: 'member', name: 'discriminator switch: outcome', lines: [4] },
|
|
1006
|
-
{ kind: 'member', name: 'case .mandatoryUpdate', lines: [5] },
|
|
1007
|
-
{ kind: 'member', name: 'case .maintenance', lines: [7] },
|
|
1008
|
-
{ kind: 'member', name: 'case .proceed', lines: [9] },
|
|
1009
|
-
]);
|
|
1010
|
-
assert.match(match.why, /OCP/);
|
|
1011
|
-
});
|
|
1012
|
-
|
|
1013
|
-
test('findSwiftXCTestSrpMatch detecta XCTestCase con responsabilidades mezcladas', () => {
|
|
1014
|
-
const source = `import XCTest
|
|
1015
|
-
|
|
1016
|
-
final class LaunchFlowCoordinatorConfigTests: XCTestCase {
|
|
1017
|
-
func test_bootstrap_whenMandatoryUpdate_routesToUpdateRequired() async {}
|
|
1018
|
-
func test_bootstrap_whenSessionIsValid_routesHome() async {}
|
|
1019
|
-
func test_completeOnboarding_marksProgressAndRoutesToLogin() async {}
|
|
1020
|
-
}
|
|
1021
|
-
`;
|
|
1022
|
-
|
|
1023
|
-
const match = findSwiftXCTestSrpMatch(source);
|
|
1024
|
-
|
|
1025
|
-
assert.ok(match);
|
|
1026
|
-
assert.equal(match.primary_node.name, 'LaunchFlowCoordinatorConfigTests');
|
|
1027
|
-
assert.deepEqual(match.related_nodes, [
|
|
1028
|
-
{ kind: 'member', name: 'session routing tests', lines: [5] },
|
|
1029
|
-
{ kind: 'member', name: 'onboarding progress tests', lines: [6] },
|
|
1030
|
-
]);
|
|
1031
|
-
assert.match(match.why, /XCTestCase|SRP/);
|
|
1032
|
-
});
|
|
1033
|
-
|
|
1034
|
-
test('findSwiftXCTestSrpMatch permite XCTestCase enfocado en una responsabilidad', () => {
|
|
1035
|
-
const source = `import XCTest
|
|
1036
|
-
|
|
1037
|
-
final class LaunchFlowCoordinatorNonBlockingConfigTests: XCTestCase {
|
|
1038
|
-
func test_bootstrap_whenConfigFetchFailsWithCache_usesCachedConfigAndContinues() async {}
|
|
1039
|
-
func test_bootstrap_whenOptionalUpdate_allowsAccessAndContinues() async {}
|
|
1040
|
-
func test_bootstrap_whenProceed_continuesToSessionValidation() async {}
|
|
1041
|
-
}
|
|
1042
|
-
`;
|
|
1043
|
-
|
|
1044
|
-
assert.equal(findSwiftXCTestSrpMatch(source), undefined);
|
|
1045
|
-
});
|
|
1046
|
-
|
|
1047
769
|
test('findSwiftInterfaceSegregationMatch devuelve payload semantico para ISP-iOS en application', () => {
|
|
1048
770
|
const source = `
|
|
1049
771
|
protocol PumukiIspIosCanarySessionManaging {
|