Skip to content

Commit

Permalink
Refactor: Linter trailing whitespace (#385)
Browse files Browse the repository at this point in the history
* Adding a linter test for trailing whitespaces and removing them

* Removing false dot
  • Loading branch information
jb3rndt authored Jun 11, 2021
1 parent bc4b053 commit 4f7b94e
Show file tree
Hide file tree
Showing 52 changed files with 106 additions and 108 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
events
addChat: aChatEvent

| chat |
| chat |
chat := TCCChat newFromChatEvent: aChatEvent.
(chat type = 'chatTypeSupergroup') ifTrue: [
self loadSuperGroupInfoFor: chat with: (((aChatEvent at: 'chat') at: 'type') at: 'supergroup_id').
Expand All @@ -11,5 +11,5 @@ addChat: aChatEvent
].

self core chats
add: chat;
add: chat;
notify.
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ chatHistoryReceived: aChatHistory
(aChatHistory at: 'messages') do: [:message | chat addOldestMessage: (TCCMessage newFromMessageEvent: message in: chat)].

chat waitingForUpdate: false.
chat stillRequestedMessages > 0
ifTrue: [self

chat stillRequestedMessages > 0
ifTrue: [self
getChatHistoryFrom: chatID
with: chat messages last id
limit: chat stillRequestedMessages]].
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ updateLastMessage: anEvent
detect: [:e | ((e at: 'list') at: '@type') = 'chatListMain'])
at: 'order')].

(content at: '@type') = 'messageText'
(content at: '@type') = 'messageText'
ifTrue: [chat lastMessage: ((content at: 'text') at: 'text')]
ifFalse: [chat lastMessage: 'message type not supported yet'].

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
"class" : {
},
"instance" : {
"addChat:" : "per 5/21/2021 16:55",
"addChat:" : "JB 6/4/2021 21:34",
"addNewMessage:from:" : "per 5/21/2021 16:55",
"chatHistoryReceived:" : "per 5/21/2021 16:55",
"chatHistoryReceived:" : "JB 6/4/2021 21:35",
"client" : "per 5/21/2021 16:55",
"core" : "per 5/21/2021 16:55",
"core:" : "per 5/21/2021 16:55",
Expand All @@ -20,4 +20,4 @@
"searchChat:" : "f.w. 7/15/2020 22:53",
"sendMessage:to:" : "js 7/31/2020 14:39",
"updateChatPosition:" : "per 5/21/2021 16:55",
"updateLastMessage:" : "per 5/21/2021 16:55" } }
"updateLastMessage:" : "JB 6/4/2021 21:36" } }
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ initialize
self
initializeHandlers;
chats: TCCChats newWithDefaultSorting;
loggedInUserID: 0;
loggedInUserID: 0;
pendingRequests: Dictionary new;
users: (TCCUsers new core: self).

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ tryHandleError: anError
(anError at: 'message') caseOf: {
['USERNAME_NOT_OCCUPIED'] -> [UIManager default inform: TCCErrorConstants unknownUsername].
['USERNAME_INVALID'] -> [UIManager default inform: TCCErrorConstants unknownUsername].
['PHONE_NUMBER_INVALID'] -> [UIManager default inform: TCCErrorConstants invalidAuthenticationCode].
['PHONE_NUMBER_INVALID'] -> [UIManager default inform: TCCErrorConstants invalidAuthenticationCode].
['PHONE_CODE_INVALID'] -> [UIManager default inform: TCCErrorConstants invalidAuthenticationCode]}
otherwise: [
((anError at: 'message') beginsWith: 'Can''t lock file')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"handleEvent:" : "per 5/26/2021 14:04",
"handleMessageEvent:" : "pk 5/19/2021 11:29",
"handlePendingEvent:" : "per 5/26/2021 14:03",
"initialize" : "RS 6/3/2021 11:54",
"initialize" : "JB 6/10/2021 22:29",
"initializeHandlers" : "per 5/21/2021 16:55",
"isClientAlive" : "js 5/28/2020 17:18",
"loggedInUserID" : "rs 7/5/2020 14:48",
Expand All @@ -32,7 +32,7 @@
"sendMessage:to:" : "rs 6/13/2020 15:26",
"sendPhoneNumber:" : "js 6/13/2020 15:35",
"setUserID:" : "per 5/13/2021 08:22",
"tryHandleError:" : "pk 5/7/2021 12:23",
"tryHandleError:" : "JB 6/4/2021 17:28",
"update" : "RS 6/3/2021 12:09",
"users" : "RK 5/19/2021 09:56",
"users:" : "RK 5/19/2021 09:56" } }
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ instance creation
newFromMessageEvent: aMessageEvent in: aChat

^ self new
message: (((aMessageEvent at: 'content') at: '@type') = 'messageText'
message: (((aMessageEvent at: 'content') at: '@type') = 'messageText'
ifTrue: [((aMessageEvent at: 'content') at: 'text') at: 'text']
ifFalse: ['message type not supported yet']);
chat: aChat;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
instance creation
newFromMessageEvent: aMessageEvent in: aChat from: aUser

^ (self newFromMessageEvent: aMessageEvent in: aChat)
^ (self newFromMessageEvent: aMessageEvent in: aChat)
sender: aUser;
yourself
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"class" : {
"newFromMessageEvent:in:" : "pk 5/17/2021 20:44",
"newFromMessageEvent:in:from:" : "pk 5/17/2021 20:44",
"newFromMessageEvent:in:" : "JB 6/4/2021 21:14",
"newFromMessageEvent:in:from:" : "JB 6/4/2021 21:14",
"timeStampToDateAndTime:" : "JB 5/16/2021 09:42" },
"instance" : {
"chat" : "pk 5/7/2021 12:06",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
accessing
initialize

self
username: '';
firstName: '';
lastName: '';
self
username: '';
firstName: '';
lastName: '';
id: -1
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"fullName" : "per 5/15/2021 12:03",
"id" : "pk 5/9/2021 16:33",
"id:" : "per 5/13/2021 09:18",
"initialize" : "per 5/16/2021 15:28",
"initialize" : "JB 6/4/2021 17:29",
"lastName" : "per 5/15/2021 12:03",
"lastName:" : "per 5/15/2021 12:03",
"username" : "pk 5/9/2021 16:33",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
utility
requestUserFor: aUserId

self core
registerCallback:
self core
registerCallback:
[:userEvent | (self at: aUserId) resolveWith: (TCCUser newFrom: userEvent)]
with: (aUserId asString).

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@
"core" : "RK 5/19/2021 10:34",
"core:" : "RK 5/19/2021 10:34",
"getUserFor:" : "pk 5/30/2021 12:55",
"requestUserFor:" : "pk 5/30/2021 13:19" } }
"requestUserFor:" : "JB 6/4/2021 21:03" } }
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@ drawing
addBackButton

| backButton |

backButton := TCUButton new
text: 'Back';
on: #mouseDown send: #buttonBackPressed to: self;
name: 'infoBackButton';
yourself.

self infoBar addMorph: backButton.
backButton position: (self infoBar left + self defaultSpacing) @ (self infoBar top + self defaultSpacing).
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
drawing
addInfoText

self infoBar addMorphCentered: (TextMorph new
contents: 'Info' asText;
lock).
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
"class" : {
"newFor:withBounds:" : "RS 5/29/2021 18:05" },
"instance" : {
"addBackButton" : "JB 5/27/2021 09:08",
"addBackButton" : "JB 6/4/2021 16:42",
"addContent" : "RS 5/29/2021 18:12",
"addDescription" : "RS 5/29/2021 18:00",
"addDescriptionText" : "JB 5/31/2021 15:05",
"addInfoBar" : "RS 5/20/2021 21:28",
"addInfoText" : "RS 5/20/2021 21:22",
"addInfoText" : "JB 6/4/2021 16:36",
"buttonBackPressed" : "RS 5/20/2021 19:48",
"chat" : "RS 5/29/2021 18:46",
"chat:" : "RS 5/29/2021 18:46",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ addMemberCount

self selectedChat memberCount notNil ifTrue: [
self titleBar addMorphBack: (
TextMorph new contents: ('Members: ' , self selectedChat memberCount) asString;
TextMorph new contents: ('Members: ' , self selectedChat memberCount) asString;
lock
)
]
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"addChatTitle" : "RS 5/20/2021 18:31",
"addHiddenInfoPage" : "JB 5/31/2021 15:11",
"addInputBar" : "js 6/13/2020 17:59",
"addMemberCount" : "TR 5/30/2021 13:25",
"addMemberCount" : "JB 6/4/2021 21:48",
"addMessageWindow" : "f.w. 8/1/2020 02:37",
"addSendButton" : "js 6/13/2020 18:46",
"addTextInputField" : "js 8/2/2020 23:19",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
initialization
addTitle: aString
addTitle: aString

| font |

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"addCloseButton" : "r.s 8/2/2020 19:02",
"addLogoutButton" : "r.s 8/2/2020 19:03",
"addNewChatButton" : "js 8/2/2020 22:21",
"addTitle:" : "r.s 8/2/2020 18:52",
"addTitle:" : "JB 6/4/2021 21:00",
"defaultHeight" : "r.s 8/2/2020 18:59",
"defaultSpacing" : "r.s 8/2/2020 18:54",
"initialize" : "r.s 8/2/2020 19:02",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
drawing
addHeader

self
self
header: (TCUHeaderBar newForMain: self);
addMorph: self header.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"newWithCore:" : "f.w. 6/3/2020 20:31" },
"instance" : {
"addChatsList" : "js 8/2/2020 22:05",
"addHeader" : "js 8/2/2020 22:05",
"addHeader" : "JB 6/4/2021 21:37",
"chatWindow" : "R.S 6/1/2020 14:27",
"chatWindow:" : "R.S 6/1/2020 14:27",
"chatsList" : "R.S 6/1/2020 14:27",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
default values
defaultMargins

^ 0 @ 0 extent: 0 @ self defaultBottomMargin
^ 0 @ 0 extent: 0 @ self defaultBottomMargin
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
default values
defaultTextMorph

^ TextMorph new
^ TextMorph new
wrapFlag: true;
lock;
yourself
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
"defaultBottomMargin" : "JB 5/30/2021 11:27",
"defaultHeight" : "JB 5/29/2021 20:44",
"defaultLayoutInset" : "JB 5/29/2021 21:08",
"defaultMargins" : "JB 5/30/2021 11:27",
"defaultTextMorph" : "JB 5/29/2021 19:59",
"defaultMargins" : "JB 6/4/2021 21:38",
"defaultTextMorph" : "JB 6/4/2021 21:38",
"defaultWidth" : "r.s 7/31/2020 14:19",
"initialize" : "JB 5/29/2021 21:07",
"initializeDefaults" : "JB 5/30/2021 11:23",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ instance creation
newWithMessage: aMessage

^ self basicNew
sender: aMessage sender;
chat: aMessage chat;
message: aMessage;
sender: aMessage sender;
chat: aMessage chat;
message: aMessage;
initialize
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
initialization
chatTitle
chatTitle

^ self chat isPrivate
ifTrue: ['']
^ self chat isPrivate
ifTrue: ['']
ifFalse: [self chat title]
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
initialization
openInWorld

super openInWorld.
self
position: self calculatePosition;
super openInWorld.

self
position: self calculatePosition;
startTimeOut
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
{
"class" : {
"newWithMessage:" : "per 5/13/2021 08:50" },
"newWithMessage:" : "JB 6/4/2021 21:48" },
"instance" : {
"addContent" : "per 5/16/2021 15:20",
"calculatePosition" : "rs 7/5/2020 14:42",
"chat" : "per 5/13/2021 08:50",
"chat:" : "per 5/13/2021 09:21",
"chatID" : "rs 7/5/2020 14:31",
"chatID:" : "rs 7/5/2020 14:31",
"chatTitle" : "pk 5/19/2021 11:50",
"chatTitle" : "JB 6/4/2021 21:51",
"defaultAuthorOffset" : "per 5/15/2021 11:57",
"defaultBorderWidth" : "r.s 8/2/2020 18:37",
"defaultChatOffset" : "per 5/15/2021 11:57",
Expand All @@ -24,7 +24,7 @@
"initializeDefaults" : "per 5/11/2021 19:04",
"message" : "per 5/13/2021 08:50",
"message:" : "per 5/13/2021 09:21",
"openInWorld" : "per 5/16/2021 15:18",
"openInWorld" : "JB 6/4/2021 21:52",
"sender" : "per 5/13/2021 08:50",
"sender:" : "per 5/13/2021 09:21",
"startTimeOut" : "r.s 8/2/2020 18:36" } }

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,5 @@
"class" : {
},
"instance" : {
"handlePendingEvent:" : "JB 6/7/2021 09:18",
"initializeHandlers" : "JB 6/7/2021 09:27",
"loginWithTestData" : "RS 5/26/2021 13:57" } }
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ testUserConstructor

| user |
user := TCCUser newFrom: TCTMMocks mockUserEvent.
self assert: TCTMMocks mockUser firstName equals: user firstName.
self assert: TCTMMocks mockUser lastName equals: user lastName.
self assert: TCTMMocks mockUser username equals: user username.
self assert: TCTMMocks mockUser fullName equals: user fullName.

self assert: TCTMMocks mockUser firstName equals: user firstName.
self assert: TCTMMocks mockUser lastName equals: user lastName.
self assert: TCTMMocks mockUser username equals: user username.
self assert: TCTMMocks mockUser fullName equals: user fullName.
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
"class" : {
},
"instance" : {
"testUserConstructor" : "JB 6/7/2021 09:28" } }
"testUserConstructor" : "JB 6/10/2021 22:44" } }
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
private
hasTrailingWhitespaces: aString

^ (self isLineWithOnlyTabsAndSpaces: aString) not and: [aString last = Character space or: [aString last = Character tab]]
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ private
methodsLinesDo: aBlock excludeClasses: aCollection

self methodTestObjects do: [:aSLMethodTestObject |
(aCollection includes: (aSLMethodTestObject parent testClass))
(aCollection includes: (aSLMethodTestObject parent testClass))
ifFalse: [
aBlock value: aSLMethodTestObject sourceCode string lines
]
Expand Down
Loading

0 comments on commit 4f7b94e

Please sign in to comment.