diff --git a/repository/OpenPonk-Core/ManifestOpenPonkCore.class.st b/repository/OpenPonk-Core/ManifestOpenPonkCore.class.st index 0a3273a8..1d08589e 100644 --- a/repository/OpenPonk-Core/ManifestOpenPonkCore.class.st +++ b/repository/OpenPonk-Core/ManifestOpenPonkCore.class.st @@ -15,3 +15,10 @@ ManifestOpenPonkCore class >> ruleRTInvocationSequenceRuleV1FalsePositive [ ManifestOpenPonkCore class >> ruleReTestClassNotInPackageWithTestEndingNameV1FalsePositive [ ^ #(#(#(#RGPackageDefinition #(#'OpenPonk-Core')) #'2020-05-27T10:56:37.652665+02:00') ) ] + +{ #category : 'code-critics' } +ManifestOpenPonkCore class >> ruleStringConcatenationRuleV1FalsePositive [ + + + ^ #(#(#(#RGMethodDefinition #(#OPMementoDirectorySerializer #loadModelFrom: #false)) #'2024-10-17T12:14:35.401+02:00') ) +] diff --git a/repository/OpenPonk-Core/OPMementoDirectorySerializer.class.st b/repository/OpenPonk-Core/OPMementoDirectorySerializer.class.st index 97fe2b80..d0c4d81e 100644 --- a/repository/OpenPonk-Core/OPMementoDirectorySerializer.class.st +++ b/repository/OpenPonk-Core/OPMementoDirectorySerializer.class.st @@ -45,9 +45,11 @@ OPMementoDirectorySerializer >> loadDiagramsOf: aModel from: aFolder [ ifFound: [ :exportInfoFile | OPSerializer forExportInfoFile: exportInfoFile ] ifNone: [ OPJsonDiagramSerializer new ]. - ^ ((aFolder filesMatching: '*.' , materializer fileExtension) - reject: [ :any | any basename = OPExportInfo fileName ]) - collect: [ :eachFile | + ^ aFolder files + select: [ :any | + (materializer fileExtensions includes: any extension) and: [ + any basename ~= OPExportInfo fileName ] ] + thenCollect: [ :eachFile | self loadDiagramOf: aModel from: eachFile by: materializer ] ] @@ -75,8 +77,16 @@ OPMementoDirectorySerializer >> loadModelFrom: aFolder [ plugin modelSerializerClass forExportInfoFile: exportInfoFile ] ifNone: [ plugin modelSerializerClass new ]. - modelFile := aFolder / 'model' , materializer fileExtension. - modelFile exists ifFalse: [ ^ nil ]. + + modelFile := aFolder files + detect: [ :anyFile | + materializer fileExtensions anySatisfy: [ + :anyExtension | + anyFile basename = ('model.' , anyExtension) ] ] + ifNone: [ + self error: + 'Failed to find model file in .opp' + , aFolder absolutePath pathString ]. ^ modelFile readStreamDo: [ :stream | materializer materializeModelFrom: stream ] ] diff --git a/repository/OpenPonk-Core/OPSerializer.class.st b/repository/OpenPonk-Core/OPSerializer.class.st index 908a751b..c4e9bdb8 100644 --- a/repository/OpenPonk-Core/OPSerializer.class.st +++ b/repository/OpenPonk-Core/OPSerializer.class.st @@ -30,7 +30,13 @@ OPSerializer class >> exportVersion [ { #category : 'accessing' } OPSerializer class >> fileExtension [ - ^ self formatName + ^ self fileExtensions first +] + +{ #category : 'accessing' } +OPSerializer class >> fileExtensions [ + + ^ { self formatName } ] { #category : 'as yet unclassified' } @@ -102,6 +108,11 @@ OPSerializer >> fileExtension [ ^ self class fileExtension ] +{ #category : 'accessing' } +OPSerializer >> fileExtensions [ + ^ self class fileExtensions +] + { #category : 'formatting' } OPSerializer >> formatName [ ^ self class formatName diff --git a/repository/OpenPonk-Spec/ManifestOpenPonkSpec.class.st b/repository/OpenPonk-Spec/ManifestOpenPonkSpec.class.st index dfe33778..3cda8055 100644 --- a/repository/OpenPonk-Spec/ManifestOpenPonkSpec.class.st +++ b/repository/OpenPonk-Spec/ManifestOpenPonkSpec.class.st @@ -13,3 +13,17 @@ Class { ManifestOpenPonkSpec class >> ruleRBContainsRuleV1FalsePositive [ ^ #(#(#(#RGMethodDefinition #(#OPModelTypeSelector #addModel #false)) #'2021-03-04T21:09:27.51689+01:00') ) ] + +{ #category : 'code-critics' } +ManifestOpenPonkSpec class >> ruleRefersToClassRuleV1FalsePositive [ + + + ^ #(#(#(#RGMethodDefinition #(#'OPLegacyProjectLoadTest class' #generateFromProjectFile: #true)) #'2024-10-17T11:08:54.945+02:00') ) +] + +{ #category : 'code-critics' } +ManifestOpenPonkSpec class >> ruleTempsReadBeforeWrittenRuleV1FalsePositive [ + + + ^ #(#(#(#RGMethodDefinition #(#'OPLegacyProjectLoadTest class' #generateFromProjectFile: #true)) #'2024-10-17T11:08:51.1+02:00') ) +] diff --git a/repository/OpenPonk-Spec/OPLegacyProjectLoadTest.class.st b/repository/OpenPonk-Spec/OPLegacyProjectLoadTest.class.st new file mode 100644 index 00000000..a3c9b31a --- /dev/null +++ b/repository/OpenPonk-Spec/OPLegacyProjectLoadTest.class.st @@ -0,0 +1,96 @@ +Class { + #name : 'OPLegacyProjectLoadTest', + #superclass : 'TestCase', + #instVars : [ + 'workbench' + ], + #category : 'OpenPonk-Spec-Tests', + #package : 'OpenPonk-Spec', + #tag : 'Tests' +} + +{ #category : 'generating' } +OPLegacyProjectLoadTest class >> generateFromDesktopProjects [ + +