Skip to content

Commit

Permalink
Refactor: Linter test for only class-sided default values (#392)
Browse files Browse the repository at this point in the history
* Creating Linter test for only class-sided default values and moved all default values to class side

* Fixes from merge
  • Loading branch information
jb3rndt authored Jun 13, 2021
1 parent 5bdd69b commit 0c5f139
Show file tree
Hide file tree
Showing 103 changed files with 160 additions and 164 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ initialize
messages: (OrderedCollection newFrom: {TCCNullMessage new});
waitingForUpdate: false;
positionKnown: false;
numberOfRequestedMessages: self defaultNumberOfRequestedMessages.
numberOfRequestedMessages: self class defaultNumberOfRequestedMessages.
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
{
"class" : {
"defaultNumberOfRequestedMessages" : "js 8/1/2020 18:52",
"newFromChatEvent:" : "JB 5/31/2021 16:21" },
"instance" : {
"addNewestMessage:" : "js 8/2/2020 12:58",
"addOldestMessage:" : "js 8/2/2020 12:58",
"canSendMessages" : "5/11/2021 10:09:15",
"canSendMessages:" : "TR 5/5/2021 16:31",
"defaultNumberOfRequestedMessages" : "js 8/1/2020 18:52",
"id" : "rs 6/7/2020 22:20",
"id:" : "5/11/2021 10:09:15",
"ifNotWaitingForUpdate:" : "js 8/2/2020 13:17",
"initialize" : "per 5/26/2021 14:02",
"initialize" : "JB 6/11/2021 18:31",
"initializeFromChatEvent:" : "JB 5/31/2021 16:19",
"isGroup" : "RS 5/29/2021 18:12",
"isPrivate" : "per 5/13/2021 08:48",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
{
"class" : {
},
"defaultMessageLimit" : "js 8/1/2020 18:24" },
"instance" : {
"addChat:" : "JB 6/4/2021 21:34",
"addNewMessage:" : "pk 6/8/2021 09:31",
"chatHistoryReceived:" : "JB 6/13/2021 10:59",
"client" : "per 5/21/2021 16:55",
"core" : "per 5/21/2021 16:55",
"core:" : "per 5/21/2021 16:55",
"defaultMessageLimit" : "js 8/1/2020 18:24",
"getChatHistoryFrom:with:limit:" : "per 5/21/2021 16:55",
"getChats" : "js 7/31/2020 22:50",
"handleNewMessage:" : "pk 6/8/2021 09:32",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ getChatHistoryFrom: aChatID
self chatsHandler
getChatHistoryFrom: aChatID
with: (self chats getChat: aChatID) messages last id
limit: self chatsHandler defaultMessageLimit.
limit: self chatsHandler class defaultMessageLimit.
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"client" : "R.S 5/20/2020 16:08",
"client:" : "js 6/13/2020 19:10",
"freeClient" : "JB 6/7/2021 11:14",
"getChatHistoryFrom:" : "js 8/1/2020 18:19",
"getChatHistoryFrom:" : "JB 6/11/2021 18:27",
"getOwnProfile" : "pk 5/13/2021 09:44",
"handleEvent:" : "per 5/26/2021 14:04",
"handleMessageEvent:" : "pk 6/11/2021 10:20",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
defaultValues
default values
defaultExtent

^ 600 @ 400
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
defaultValues
default values
defaultHeaderHeight

^ 40
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
defaultValues
default values
defaultInputWidth

^ 150
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ addHeader
header := RectangleMorph new
borderWidth: 0;
color: TCUDefaultValues colorGray;
extent: self width @ self defaultHeaderHeight.
extent: self width @ self class defaultHeaderHeight.

self
addMorph: header;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ createErrorLabel: aString
self
errorLabel: (TextMorph new
contents: aString asText;
center: (self center + (0 @ (self defaultExtent y / 3)));
center: (self center + (0 @ (self class defaultExtent y / 3)));
color: Color red;
lock);
addMorph: self errorLabel.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ createInputField: aString
self
inputField: (TextMorph new
contentsWrapped: aString asText;
extent: self defaultInputWidth @ 50;
extent: self class defaultInputWidth @ 50;
borderColor: TCUDefaultValues colorGray;
borderWidth: 1;
center: self instructionLabel center + (0 @ 30);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ initialize
super initialize.
self
subscribeCore;
extent: self defaultExtent;
extent: self class defaultExtent;
color: Color white;
borderWidth: 1;
borderColor: TCUDefaultValues colorGray;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
{
"class" : {
"defaultExtent" : "R.S 5/20/2020 13:51",
"defaultHeaderHeight" : "r.s 8/2/2020 21:29",
"defaultInputWidth" : "R.S 5/20/2020 13:51",
"newWithCore:" : "R.S 5/31/2020 20:16" },
"instance" : {
"addHeader" : "r.s 8/2/2020 21:29",
"addHeader" : "JB 6/11/2021 18:28",
"addTitle:to:" : "N.S. 7/26/2020 15:52",
"buttonBack" : "rs 6/11/2020 18:53",
"buttonBack:" : "rs 6/11/2020 18:53",
Expand All @@ -18,16 +21,13 @@
"createButtonBack" : "js 7/31/2020 15:17",
"createButtonNext" : "js 7/31/2020 15:17",
"createButtonVerify" : "js 6/13/2020 18:44",
"createErrorLabel:" : "js 7/31/2020 15:18",
"createInputField:" : "js 7/31/2020 15:18",
"createErrorLabel:" : "JB 6/11/2021 18:28",
"createInputField:" : "JB 6/11/2021 18:28",
"createLabel:" : "js 6/13/2020 18:13",
"defaultExtent" : "R.S 5/20/2020 13:51",
"defaultHeaderHeight" : "r.s 8/2/2020 21:29",
"defaultInputWidth" : "R.S 5/20/2020 13:51",
"delete" : "JB 6/7/2021 11:11",
"errorLabel" : "R.S 5/20/2020 13:51",
"errorLabel:" : "R.S 5/20/2020 13:51",
"initialize" : "js 6/13/2020 18:44",
"initialize" : "JB 6/11/2021 18:36",
"initializeMorphs" : "js 5/29/2020 20:11",
"inputField" : "R.S 5/20/2020 13:51",
"inputField:" : "js 5/31/2020 20:07",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ addBackButton
yourself.

self infoBar addMorph: backButton.
backButton position: (self infoBar left + self defaultSpacing) @ (self infoBar top + self defaultSpacing).
backButton position: (self infoBar left + self class defaultSpacing) @ (self infoBar top + self class defaultSpacing).
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ createContentWrapper
self contentWrapper: (RectangleMorph new
borderWidth: 0;
color: Color transparent;
width: self width * self defaultContentWidthPercentage;
height: self height - self defaultInfoBarHeight;
center: self center + (0 @ (self defaultInfoBarHeight / 2));
width: self width * self class defaultContentWidthPercentage;
height: self height - self class defaultInfoBarHeight;
center: self center + (0 @ (self class defaultInfoBarHeight / 2));
layoutPolicy: TableLayout new;
listDirection: #topToBottom;
hResizing: #spaceFill;
vResizing: #spaceFill;
layoutInset: self defaultContentLayoutInset;
cellInset: self defaultContentInset).
layoutInset: self class defaultContentLayoutInset;
cellInset: self class defaultContentInset).
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ createDescription
listDirection: #topToBottom;
hResizing: #spaceFill;
vResizing: #shrinkWrap;
cellInset: self defaultContentInset;
cellInset: self class defaultContentInset;
useRoundedCorners;
yourself).
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@ createInfoBar
borderWidth: 0;
color: Color white;
width: self width;
height: self defaultInfoBarHeight;
height: self class defaultInfoBarHeight;
topLeft: self topLeft;
yourself).
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
{
"class" : {
"defaultContentInset" : "RS 5/29/2021 18:32",
"defaultContentLayoutInset" : "RS 5/29/2021 18:49",
"defaultContentWidthPercentage" : "RS 5/29/2021 18:49",
"defaultInfoBarHeight" : "RS 5/20/2021 21:30",
"defaultSpacing" : "RS 5/20/2021 20:57",
"newFor:withBounds:" : "RS 5/29/2021 18:05" },
"instance" : {
"addBackButton" : "JB 6/4/2021 16:42",
"addBackButton" : "JB 6/11/2021 15:31",
"addContent" : "RS 5/29/2021 18:12",
"addDescription" : "RS 5/29/2021 18:00",
"addDescriptionText" : "JB 5/31/2021 15:05",
Expand All @@ -13,14 +18,9 @@
"chat:" : "RS 5/29/2021 18:46",
"contentWrapper" : "RS 5/29/2021 18:46",
"contentWrapper:" : "RS 5/29/2021 18:46",
"createContentWrapper" : "RS 5/29/2021 18:50",
"createDescription" : "RS 5/29/2021 18:32",
"createInfoBar" : "RS 5/20/2021 21:31",
"defaultContentInset" : "RS 5/29/2021 18:32",
"defaultContentLayoutInset" : "RS 5/29/2021 18:49",
"defaultContentWidthPercentage" : "RS 5/29/2021 18:49",
"defaultInfoBarHeight" : "RS 5/20/2021 21:30",
"defaultSpacing" : "RS 5/20/2021 20:57",
"createContentWrapper" : "JB 6/11/2021 15:31",
"createDescription" : "JB 6/11/2021 15:31",
"createInfoBar" : "JB 6/11/2021 18:35",
"description" : "RS 5/29/2021 18:46",
"description:" : "RS 5/29/2021 18:47",
"infoBar" : "RS 5/20/2021 21:38",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
default values
lastMessageOffset
defaultLastMessageOffset

^ 20 @ -12
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
default values
defaultMessagePreviewLength

^ 37
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
default values
titleLength
defaultTitleLength

^ 32
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
default values
titleOffset
defaultTitleOffset

^ 20 @ 20
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ addBorder
width: self width;
color: Color black;
height: 1;
position: (self position + (0 @ (self defaultHeight - 1)))).
position: (self position + (0 @ (self class defaultHeight - 1)))).
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@ drawing
addLastMessage

self addMorph: (TextMorph new
contents: (self chat lastMessage condensedIntoOneLine truncateWithElipsisTo: self messagePreviewLength) asText;
bottomLeft: self bottomLeft + self lastMessageOffset;
contents: (self chat lastMessage condensedIntoOneLine truncateWithElipsisTo: self class defaultMessagePreviewLength) asText;
bottomLeft: self bottomLeft + self class defaultLastMessageOffset;
lock).
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@ drawing
addTitle

self addMorph: (TextMorph new
position: self topLeft + self titleOffset;
contents: ((self chatName condensedIntoOneLine truncateWithElipsisTo: self titleLength) asText addAttribute: TextEmphasis bold);
position: self topLeft + self class defaultTitleOffset;
contents: ((self chatName condensedIntoOneLine truncateWithElipsisTo: self class defaultTitleLength) asText addAttribute: TextEmphasis bold);
lock).
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@ initialize

self
color: Color white;
height: self defaultHeight;
height: self class defaultHeight;
borderWidth: 0;
clipSubmorphs: true.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,20 +1,19 @@
{
"class" : {
"defaultHeight" : "rs 7/4/2020 18:54",
"defaultLastMessageOffset" : "JB 6/11/2021 15:17",
"defaultMessagePreviewLength" : "JB 6/11/2021 15:17",
"defaultTitleLength" : "JB 6/11/2021 15:18",
"defaultTitleOffset" : "JB 6/11/2021 15:18",
"newWithChat:width:" : "js 7/31/2020 18:48" },
"instance" : {
"addBorder" : "r.s 7/31/2020 14:43",
"addLastMessage" : "js 8/2/2020 09:58",
"addTitle" : "js 8/2/2020 09:58",
"addBorder" : "JB 6/11/2021 18:35",
"addLastMessage" : "JB 6/11/2021 15:18",
"addTitle" : "JB 6/11/2021 15:18",
"chat" : "rs 6/17/2020 21:45",
"chat:" : "rs 6/17/2020 21:45",
"chatID" : "rs 6/17/2020 23:05",
"chatName" : "rs 6/17/2020 21:45",
"defaultHeight" : "rs 7/4/2020 18:54",
"deselect" : "rs 6/13/2020 09:02",
"initialize" : "r.s 7/31/2020 14:43",
"lastMessageOffset" : "r.s 7/31/2020 16:05",
"messageMarginTop" : "r.s 7/31/2020 14:18",
"messagePreviewLength" : "js 8/2/2020 10:06",
"select" : "rs 6/13/2020 08:49",
"titleLength" : "js 8/2/2020 10:00",
"titleOffset" : "r.s 7/31/2020 16:04" } }
"initialize" : "JB 6/11/2021 18:35",
"select" : "rs 6/13/2020 08:49" } }
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ addMessageAtBottom: aMessage
| newMessage |
newMessage := TCUMessage newFromTCCMessage: aMessage.

self messages do: [:message | message position: (message position - (0 @ (newMessage height + self defaultMessageMargin)))].
self messages do: [:message | message position: (message position - (0 @ (newMessage height + self class defaultMessageMargin)))].

newMessage isOutgoing
ifTrue: [newMessage bottomRight: (self bottomRight - (self defaultMessageMargin asPoint))]
ifFalse: [newMessage bottomLeft: (self bottomLeft + (self defaultMessageMargin @ self defaultMessageMargin negated))].
ifTrue: [newMessage bottomRight: (self bottomRight - (self class defaultMessageMargin asPoint))]
ifFalse: [newMessage bottomLeft: (self bottomLeft + (self class defaultMessageMargin @ self class defaultMessageMargin negated))].
self addMorph: newMessage.
self messages add: newMessage.
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
{
"class" : {
},
"defaultMessageMargin" : "js 7/31/2020 15:50" },
"instance" : {
"addMessageAtBottom:" : "JB 5/29/2021 20:42",
"addMessageAtBottom:" : "JB 6/11/2021 18:25",
"addMessages" : "js 8/2/2020 22:16",
"chat" : "js 7/31/2020 16:39",
"chat:" : "js 7/31/2020 16:39",
"clearMessages" : "js 7/31/2020 16:46",
"core" : "js 8/2/2020 22:11",
"defaultMessageMargin" : "js 7/31/2020 15:50",
"displayChat:" : "f.w. 8/1/2020 04:53",
"handleMouseWheel:" : "f.w. 7/31/2020 23:53",
"initialize" : "js 7/31/2020 17:19",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ addMessageWindow

self
messageListWindow: (TCUChatMessageList new
height: self height - self defaultInputfieldHeight;
height: self height - self class defaultInputfieldHeight;
width: self width;
color: Color white;
lowestVisibleMessage: 0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ addTextInputField
borderWidth: 2;
borderColor: TCUDefaultValues colorLightBlue;
contentsWrapped: '' asText;
extent: ((self inputBar width - 200) @ self defaultInputfieldHeight);
extent: ((self inputBar width - 200) @ self class defaultInputfieldHeight);
crAction: [self buttonSendPressed]).

self inputBar addMorph: self textInputField.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ createInputBar
borderWidth: 0;
color: TCUDefaultValues colorLightGray;
width: self width;
height: self defaultInputfieldHeight;
height: self class defaultInputfieldHeight;
bottomLeft: (self bottomLeft);
layoutPolicy: TableLayout new;
listDirection: #leftToRight;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ createTitleBar
borderWidth: 0;
color: TCUDefaultValues colorLightGray;
width: self width;
height: self defaultTitleBarHeigth;
height: self class defaultTitleBarHeigth;
topLeft: self topLeft;
layoutPolicy: TableLayout new;
listDirection: #leftToRight;
Expand Down
Loading

0 comments on commit 0c5f139

Please sign in to comment.