From 334a4cd6660ce6d7deea0cb8465ccdf1f147fd82 Mon Sep 17 00:00:00 2001 From: Yannis-Hofmann Date: Thu, 2 Jun 2022 10:48:35 +0200 Subject: [PATCH] All Methods regarding spaces and commas are named properly. (Not containing inArray anymore) Added a Test checking wether spaces before commas works without Arrays too. --- .../instance/printBinaryMessage.multiLine..st | 2 +- .../PPFormatter.class/methodProperties.json | 2 +- .../instance/spaceBeforeComma..st | 4 ++++ .../instance/spaceBeforeComma.st | 5 +++++ .../instance/spaceBeforeCommaInArray..st | 4 ---- .../instance/spaceBeforeCommaInArray.st | 5 ----- .../PPFormatterConfig.class/methodProperties.json | 4 ++-- .../PPFormatterConfig.class/properties.json | 2 +- .../instance/getConfigSpacesBeforeComma.st | 4 ++++ .../instance/getConfigSpacesBeforeCommainArray.st | 4 ---- .../instance/testAllMethods.st | 2 +- .../instance/testSpaceBeforeComma.st | 11 +++++++++++ .../instance/testSpaceBeforeCommaInArray.st | 13 ++++++------- .../instance/testSpaceBeforePointInArray.st | 13 ++++++------- .../PPFormatterTest.class/methodProperties.json | 9 +++++---- 15 files changed, 47 insertions(+), 37 deletions(-) create mode 100644 packages/PoppyPrint-Core.package/PPFormatterConfig.class/instance/spaceBeforeComma..st create mode 100644 packages/PoppyPrint-Core.package/PPFormatterConfig.class/instance/spaceBeforeComma.st delete mode 100644 packages/PoppyPrint-Core.package/PPFormatterConfig.class/instance/spaceBeforeCommaInArray..st delete mode 100644 packages/PoppyPrint-Core.package/PPFormatterConfig.class/instance/spaceBeforeCommaInArray.st create mode 100644 packages/PoppyPrint-Tests.package/PPFormatterTest.class/instance/getConfigSpacesBeforeComma.st delete mode 100644 packages/PoppyPrint-Tests.package/PPFormatterTest.class/instance/getConfigSpacesBeforeCommainArray.st create mode 100644 packages/PoppyPrint-Tests.package/PPFormatterTest.class/instance/testSpaceBeforeComma.st diff --git a/packages/PoppyPrint-Core.package/PPFormatter.class/instance/printBinaryMessage.multiLine..st b/packages/PoppyPrint-Core.package/PPFormatter.class/instance/printBinaryMessage.multiLine..st index 4360be1..f10fb7a 100644 --- a/packages/PoppyPrint-Core.package/PPFormatter.class/instance/printBinaryMessage.multiLine..st +++ b/packages/PoppyPrint-Core.package/PPFormatter.class/instance/printBinaryMessage.multiLine..st @@ -1,7 +1,7 @@ printing printBinaryMessage: aNode multiLine: multiLine - (aNode originalSelector ~= #, or: [config spaceBeforeCommaInArray]) ifTrue: [stream space]. + (aNode originalSelector ~= #, or: [config spaceBeforeComma]) ifTrue: [stream space]. stream nextPutAll: aNode originalSelector; space. diff --git a/packages/PoppyPrint-Core.package/PPFormatter.class/methodProperties.json b/packages/PoppyPrint-Core.package/PPFormatter.class/methodProperties.json index 73baaf6..9d75948 100644 --- a/packages/PoppyPrint-Core.package/PPFormatter.class/methodProperties.json +++ b/packages/PoppyPrint-Core.package/PPFormatter.class/methodProperties.json @@ -40,7 +40,7 @@ "precedenceOf:" : "tobe 3/10/2021 14:58", "prepareMultilineLiteral:" : "tobe 3/11/2021 09:09", "printAllCommentsOf:lastStatement:" : "tobe 3/11/2021 10:08", - "printBinaryMessage:multiLine:" : "Alexander Ungefug 5/30/2022 19:12", + "printBinaryMessage:multiLine:" : "YH 6/2/2022 10:16", "printBlockComment:" : "tobe 3/11/2021 09:53", "printBlockStart:startWithNewLine:" : "tobe 3/10/2021 14:58", "printKeywordMessage:inCascade:multiLine:" : "tobe 3/10/2021 15:51", diff --git a/packages/PoppyPrint-Core.package/PPFormatterConfig.class/instance/spaceBeforeComma..st b/packages/PoppyPrint-Core.package/PPFormatterConfig.class/instance/spaceBeforeComma..st new file mode 100644 index 0000000..5e67633 --- /dev/null +++ b/packages/PoppyPrint-Core.package/PPFormatterConfig.class/instance/spaceBeforeComma..st @@ -0,0 +1,4 @@ +accessing +spaceBeforeComma: anObject + + spaceBeforeComma := anObject. \ No newline at end of file diff --git a/packages/PoppyPrint-Core.package/PPFormatterConfig.class/instance/spaceBeforeComma.st b/packages/PoppyPrint-Core.package/PPFormatterConfig.class/instance/spaceBeforeComma.st new file mode 100644 index 0000000..7e8f6a5 --- /dev/null +++ b/packages/PoppyPrint-Core.package/PPFormatterConfig.class/instance/spaceBeforeComma.st @@ -0,0 +1,5 @@ +accessing +spaceBeforeComma + + ^ spaceBeforeComma ifNil: [spaceBeforeComma := true]. + \ No newline at end of file diff --git a/packages/PoppyPrint-Core.package/PPFormatterConfig.class/instance/spaceBeforeCommaInArray..st b/packages/PoppyPrint-Core.package/PPFormatterConfig.class/instance/spaceBeforeCommaInArray..st deleted file mode 100644 index 9d26a56..0000000 --- a/packages/PoppyPrint-Core.package/PPFormatterConfig.class/instance/spaceBeforeCommaInArray..st +++ /dev/null @@ -1,4 +0,0 @@ -accessing -spaceBeforeCommaInArray: anObject - - spaceBeforeCommaInArray := anObject. \ No newline at end of file diff --git a/packages/PoppyPrint-Core.package/PPFormatterConfig.class/instance/spaceBeforeCommaInArray.st b/packages/PoppyPrint-Core.package/PPFormatterConfig.class/instance/spaceBeforeCommaInArray.st deleted file mode 100644 index 40dea83..0000000 --- a/packages/PoppyPrint-Core.package/PPFormatterConfig.class/instance/spaceBeforeCommaInArray.st +++ /dev/null @@ -1,5 +0,0 @@ -accessing -spaceBeforeCommaInArray - - ^ spaceBeforeCommaInArray ifNil: [spaceBeforeCommaInArray := true]. - \ No newline at end of file diff --git a/packages/PoppyPrint-Core.package/PPFormatterConfig.class/methodProperties.json b/packages/PoppyPrint-Core.package/PPFormatterConfig.class/methodProperties.json index 302b934..54680a2 100644 --- a/packages/PoppyPrint-Core.package/PPFormatterConfig.class/methodProperties.json +++ b/packages/PoppyPrint-Core.package/PPFormatterConfig.class/methodProperties.json @@ -2,7 +2,7 @@ "class" : { "default" : "Alexander Ungefug 5/30/2022 19:03" }, "instance" : { - "spaceBeforeCommaInArray" : "Alexander Ungefug 6/1/2022 16:46", - "spaceBeforeCommaInArray:" : "Alexander Ungefug 5/30/2022 18:59", + "spaceBeforeComma" : "YH 6/2/2022 10:19", + "spaceBeforeComma:" : "YH 6/2/2022 10:17", "spaceBeforePointInArray" : "Alexander Ungefug 6/1/2022 15:59", "spaceBeforePointInArray:" : "Alexander Ungefug 5/30/2022 18:59" } } diff --git a/packages/PoppyPrint-Core.package/PPFormatterConfig.class/properties.json b/packages/PoppyPrint-Core.package/PPFormatterConfig.class/properties.json index 1f2bce4..8d7bee4 100644 --- a/packages/PoppyPrint-Core.package/PPFormatterConfig.class/properties.json +++ b/packages/PoppyPrint-Core.package/PPFormatterConfig.class/properties.json @@ -6,7 +6,7 @@ ], "commentStamp" : "", "instvars" : [ - "spaceBeforeCommaInArray", + "spaceBeforeComma", "spaceBeforePointInArray" ], "name" : "PPFormatterConfig", "pools" : [ diff --git a/packages/PoppyPrint-Tests.package/PPFormatterTest.class/instance/getConfigSpacesBeforeComma.st b/packages/PoppyPrint-Tests.package/PPFormatterTest.class/instance/getConfigSpacesBeforeComma.st new file mode 100644 index 0000000..94271c9 --- /dev/null +++ b/packages/PoppyPrint-Tests.package/PPFormatterTest.class/instance/getConfigSpacesBeforeComma.st @@ -0,0 +1,4 @@ +helper +getConfigSpacesBeforeComma + + ^ PPFormatterConfig default spaceBeforeComma: true \ No newline at end of file diff --git a/packages/PoppyPrint-Tests.package/PPFormatterTest.class/instance/getConfigSpacesBeforeCommainArray.st b/packages/PoppyPrint-Tests.package/PPFormatterTest.class/instance/getConfigSpacesBeforeCommainArray.st deleted file mode 100644 index 78f3849..0000000 --- a/packages/PoppyPrint-Tests.package/PPFormatterTest.class/instance/getConfigSpacesBeforeCommainArray.st +++ /dev/null @@ -1,4 +0,0 @@ -helper -getConfigSpacesBeforeCommainArray - - ^ PPFormatterConfig default spaceBeforeCommaInArray: true \ No newline at end of file diff --git a/packages/PoppyPrint-Tests.package/PPFormatterTest.class/instance/testAllMethods.st b/packages/PoppyPrint-Tests.package/PPFormatterTest.class/instance/testAllMethods.st index f012476..5b021ec 100644 --- a/packages/PoppyPrint-Tests.package/PPFormatterTest.class/instance/testAllMethods.st +++ b/packages/PoppyPrint-Tests.package/PPFormatterTest.class/instance/testAllMethods.st @@ -1,6 +1,6 @@ tests - examples testAllMethods - + | methods results | methods := self systemNavigation allClasses gather: [:class | class methodDictionary values, class theMetaClass methodDictionary values]. diff --git a/packages/PoppyPrint-Tests.package/PPFormatterTest.class/instance/testSpaceBeforeComma.st b/packages/PoppyPrint-Tests.package/PPFormatterTest.class/instance/testSpaceBeforeComma.st new file mode 100644 index 0000000..9008b5c --- /dev/null +++ b/packages/PoppyPrint-Tests.package/PPFormatterTest.class/instance/testSpaceBeforeComma.st @@ -0,0 +1,11 @@ +tests - spaces in Array +testSpaceBeforeComma + + self + canFormat: 'test + + ^ ''0'', ''0'', ''0'', ''0'', ''0'', ''1''' + as: 'test + + ^ ''0'' , ''0'' , ''0'' , ''0'' , ''0'' , ''1''' + with: self getConfigSpacesBeforeComma \ No newline at end of file diff --git a/packages/PoppyPrint-Tests.package/PPFormatterTest.class/instance/testSpaceBeforeCommaInArray.st b/packages/PoppyPrint-Tests.package/PPFormatterTest.class/instance/testSpaceBeforeCommaInArray.st index 00a07bb..927d6f6 100644 --- a/packages/PoppyPrint-Tests.package/PPFormatterTest.class/instance/testSpaceBeforeCommaInArray.st +++ b/packages/PoppyPrint-Tests.package/PPFormatterTest.class/instance/testSpaceBeforeCommaInArray.st @@ -1,12 +1,11 @@ tests - spaces in Array testSpaceBeforeCommaInArray - self canFormat: -'test + self + canFormat: 'test - {0, 0, 0, 0, 0, 1}' - as: -'test + {0, 0, 0, 0, 0, 1}' + as: 'test - {0 , 0 , 0 , 0 , 0 , 1}' - with: self getConfigSpacesBeforeCommainArray \ No newline at end of file + {0 , 0 , 0 , 0 , 0 , 1}' + with: self getConfigSpacesBeforeComma \ No newline at end of file diff --git a/packages/PoppyPrint-Tests.package/PPFormatterTest.class/instance/testSpaceBeforePointInArray.st b/packages/PoppyPrint-Tests.package/PPFormatterTest.class/instance/testSpaceBeforePointInArray.st index d475ed7..7904085 100644 --- a/packages/PoppyPrint-Tests.package/PPFormatterTest.class/instance/testSpaceBeforePointInArray.st +++ b/packages/PoppyPrint-Tests.package/PPFormatterTest.class/instance/testSpaceBeforePointInArray.st @@ -1,12 +1,11 @@ tests - spaces in Array testSpaceBeforePointInArray - self canFormat: -'test + self + canFormat: 'test - {0. 0. 0. 0. 0. 1}' - as: -'test + {0. 0. 0. 0. 0. 1}' + as: 'test - {0 . 0 . 0 . 0 . 0 . 1}' - with: self getConfigSpacesBeforePointinArray \ No newline at end of file + {0 . 0 . 0 . 0 . 0 . 1}' + with: self getConfigSpacesBeforePointinArray \ No newline at end of file diff --git a/packages/PoppyPrint-Tests.package/PPFormatterTest.class/methodProperties.json b/packages/PoppyPrint-Tests.package/PPFormatterTest.class/methodProperties.json index a2cdd74..ce03965 100644 --- a/packages/PoppyPrint-Tests.package/PPFormatterTest.class/methodProperties.json +++ b/packages/PoppyPrint-Tests.package/PPFormatterTest.class/methodProperties.json @@ -10,9 +10,9 @@ "canFormatMethod:" : "ct 4/7/2021 15:51", "exampleExplorerContents" : "tobe 3/11/2021 10:20", "exampleMorphDoLayoutIn" : "tobe 3/11/2021 09:00", - "getConfigSpacesBeforeCommainArray" : "Alexander Ungefug 6/1/2022 16:41", + "getConfigSpacesBeforeComma" : "YH 6/2/2022 10:20", "getConfigSpacesBeforePointinArray" : "Alexander Ungefug 6/1/2022 16:42", - "testAllMethods" : "KD 5/11/2022 18:29", + "testAllMethods" : "YH 6/2/2022 10:14", "testBinaryMessageChain" : "tobe 3/11/2021 10:58", "testBinaryMessageChainWithParenthesis" : "tobe 3/11/2021 13:33", "testCommentAtStartOfBlock" : "tobe 3/11/2021 10:08", @@ -43,8 +43,9 @@ "testReindentMultilineComment" : "tobe 3/11/2021 10:08", "testShortArray" : "tobe 3/11/2021 10:41", "testShortCaseOf" : "tobe 3/11/2021 10:40", - "testSpaceBeforeCommaInArray" : "Alexander Ungefug 6/1/2022 16:48", - "testSpaceBeforePointInArray" : "Alexander Ungefug 6/1/2022 16:42", + "testSpaceBeforeComma" : "YH 6/2/2022 10:46", + "testSpaceBeforeCommaInArray" : "YH 6/2/2022 10:25", + "testSpaceBeforePointInArray" : "YH 6/2/2022 10:25", "testSubexpressionComment" : "tobe 3/11/2021 10:08", "testTemporaries" : "tobe 3/11/2021 11:39", "testTooLongLine" : "tobe 3/11/2021 09:21",