Skip to content

Commit

Permalink
All Methods regarding spaces and commas are named properly. (Not cont…
Browse files Browse the repository at this point in the history
…aining inArray anymore)

Added a Test checking wether spaces before commas works without Arrays too.
  • Loading branch information
Yannis-Hofmann committed Jun 2, 2022
1 parent 80a972c commit 334a4cd
Show file tree
Hide file tree
Showing 15 changed files with 47 additions and 37 deletions.
Original file line number Diff line number Diff line change
@@ -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.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
accessing
spaceBeforeComma: anObject

spaceBeforeComma := anObject.
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
accessing
spaceBeforeComma

^ spaceBeforeComma ifNil: [spaceBeforeComma := true].

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -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" } }
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
],
"commentStamp" : "",
"instvars" : [
"spaceBeforeCommaInArray",
"spaceBeforeComma",
"spaceBeforePointInArray" ],
"name" : "PPFormatterConfig",
"pools" : [
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
helper
getConfigSpacesBeforeComma

^ PPFormatterConfig default spaceBeforeComma: true

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
tests - examples
testAllMethods
<timeout: 120 "seconds">
<timeout: 180 "seconds">

| methods results |
methods := self systemNavigation allClasses gather: [:class | class methodDictionary values, class theMetaClass methodDictionary values].
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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
{0 , 0 , 0 , 0 , 0 , 1}'
with: self getConfigSpacesBeforeComma
Original file line number Diff line number Diff line change
@@ -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
{0 . 0 . 0 . 0 . 0 . 1}'
with: self getConfigSpacesBeforePointinArray
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Expand Down

0 comments on commit 334a4cd

Please sign in to comment.