pumuki 6.3.161 → 6.3.162
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.
|
@@ -752,11 +752,14 @@ test('hasSwiftNSManagedObjectBoundaryUsage detecta boundaries con NSManagedObjec
|
|
|
752
752
|
const source = `
|
|
753
753
|
func persist(_ entity: NSManagedObject) {}
|
|
754
754
|
var selectedEntity: NSManagedObject?
|
|
755
|
+
let cachedEntities: Result<[NSManagedObject], Error>
|
|
755
756
|
`;
|
|
756
757
|
const ignored = `
|
|
757
758
|
final class TodoEntity: NSManagedObject {}
|
|
758
759
|
var selectedID: NSManagedObjectID?
|
|
759
760
|
let context: NSManagedObjectContext
|
|
761
|
+
let text = "var selectedEntity: NSManagedObject?"
|
|
762
|
+
// func persist(_ entity: NSManagedObject) {}
|
|
760
763
|
`;
|
|
761
764
|
|
|
762
765
|
assert.equal(hasSwiftNSManagedObjectBoundaryUsage(source), true);
|
|
@@ -768,11 +771,17 @@ test('hasSwiftNSManagedObjectAsyncBoundaryUsage detecta async APIs con NSManaged
|
|
|
768
771
|
func fetchEntity() async throws -> NSManagedObject {
|
|
769
772
|
fatalError()
|
|
770
773
|
}
|
|
774
|
+
func fetchEntities() async throws -> Result<[NSManagedObject], Error> {
|
|
775
|
+
fatalError()
|
|
776
|
+
}
|
|
771
777
|
`;
|
|
772
778
|
const ignored = `
|
|
773
779
|
func fetchEntityID() async throws -> NSManagedObjectID {
|
|
774
780
|
fatalError()
|
|
775
781
|
}
|
|
782
|
+
func fetchContext() async throws -> NSManagedObjectContext {
|
|
783
|
+
fatalError()
|
|
784
|
+
}
|
|
776
785
|
`;
|
|
777
786
|
|
|
778
787
|
assert.equal(hasSwiftNSManagedObjectAsyncBoundaryUsage(source), true);
|
|
@@ -934,17 +934,37 @@ export const hasSwiftLegacyExpectationDescriptionUsage = (source: string): boole
|
|
|
934
934
|
});
|
|
935
935
|
};
|
|
936
936
|
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
937
|
+
const swiftManagedObjectBoundaryTypePattern = /\bNSManagedObject\b(?!ID\b|Context\b)/;
|
|
938
|
+
const swiftStoredPropertyBoundaryPattern =
|
|
939
|
+
/\b(?:var|let)\s+[A-Za-z_][A-Za-z0-9_]*\s*:\s*[^=\n]*\bNSManagedObject\b(?!ID\b|Context\b)/;
|
|
940
|
+
const swiftManagedObjectSubclassPattern =
|
|
941
|
+
/\b(?:final\s+)?class\s+[A-Za-z_][A-Za-z0-9_]*\s*:\s*NSManagedObject\b/;
|
|
942
|
+
|
|
943
|
+
const hasSwiftManagedObjectBoundaryTypeUsage = (source: string): boolean => {
|
|
944
|
+
return collectSwiftFunctionDeclarations(source).some((declaration) =>
|
|
945
|
+
swiftManagedObjectBoundaryTypePattern.test(declaration.signature)
|
|
941
946
|
);
|
|
942
947
|
};
|
|
943
948
|
|
|
949
|
+
export const hasSwiftNSManagedObjectBoundaryUsage = (source: string): boolean => {
|
|
950
|
+
if (hasSwiftManagedObjectBoundaryTypeUsage(source)) {
|
|
951
|
+
return true;
|
|
952
|
+
}
|
|
953
|
+
|
|
954
|
+
return source.split(/\r?\n/).some((line) => {
|
|
955
|
+
const sanitized = stripSwiftLineForSemanticScan(line);
|
|
956
|
+
return (
|
|
957
|
+
swiftStoredPropertyBoundaryPattern.test(sanitized) &&
|
|
958
|
+
!swiftManagedObjectSubclassPattern.test(sanitized)
|
|
959
|
+
);
|
|
960
|
+
});
|
|
961
|
+
};
|
|
962
|
+
|
|
944
963
|
export const hasSwiftNSManagedObjectAsyncBoundaryUsage = (source: string): boolean => {
|
|
945
|
-
return
|
|
946
|
-
|
|
947
|
-
|
|
964
|
+
return collectSwiftFunctionDeclarations(source).some(
|
|
965
|
+
(declaration) =>
|
|
966
|
+
/\basync\b/.test(declaration.signature) &&
|
|
967
|
+
swiftManagedObjectBoundaryTypePattern.test(declaration.signature)
|
|
948
968
|
);
|
|
949
969
|
};
|
|
950
970
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pumuki",
|
|
3
|
-
"version": "6.3.
|
|
3
|
+
"version": "6.3.162",
|
|
4
4
|
"description": "Enterprise-grade AST Intelligence System with multi-platform support (iOS, Android, Backend, Frontend) and Feature-First + DDD + Clean Architecture enforcement. Includes dynamic violations API for intelligent querying.",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"bin": {
|