Skip to content

Commit c974ea7

Browse files
refactor: Update function comments to follow consistent naming conventions (thrasher-corp#2155)
* refactor: update function comments to follow consistent naming conventions - Changed comments for various functions across multiple files to use lowercase for function names. - Improved clarity of comments to better describe the functionality of the respective functions. - Removed unnecessary comments that do not add value or context to the code. * Update exchanges/bitmex/bitmex_websocket.go Co-authored-by: Scott <gloriousCode@users.noreply.github.com> * refactor: remove outdated benchmark comments and improve clarity in test descriptions --------- Co-authored-by: Scott <gloriousCode@users.noreply.github.com>
1 parent 7dbca51 commit c974ea7

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

54 files changed

+51
-98
lines changed

backtester/data/data_test.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -586,7 +586,6 @@ func TestLast(t *testing.T) {
586586
assert.Equal(t, id3, last.GetOffset())
587587
}
588588

589-
// methods that satisfy the common.Event interface
590589
func (f fakeEvent) GetOffset() int64 {
591590
if f.secretID > 0 {
592591
return f.secretID

backtester/funding/funding.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -481,7 +481,7 @@ func (f *FundManager) GetFundingForEvent(ev common.Event) (IFundingPair, error)
481481
return f.getFundingForEAP(ev.GetExchange(), ev.GetAssetType(), ev.Pair())
482482
}
483483

484-
// GetFundingForEAP This will construct a funding based on the exchange, asset, currency pair
484+
// getFundingForEAP constructs a funding based on the exchange, asset, currency pair
485485
func (f *FundManager) getFundingForEAP(exch string, a asset.Item, p currency.Pair) (IFundingPair, error) {
486486
if a.IsFutures() {
487487
var collat CollateralPair

common/cache/cache.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ func (l *LRUCache) Get(key any) (value any) {
2121
return l.lru.Get(key)
2222
}
2323

24-
// GetOldest looks up old key's value from the cache.
24+
// getOldest looks up old key's value from the cache
2525
func (l *LRUCache) getOldest() (key, value any) {
2626
l.m.Lock()
2727
defer l.m.Unlock()

common/cache/lru.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ func (l *LRU) Get(key any) any {
4949
return nil
5050
}
5151

52-
// GetOldest returns the oldest entry
52+
// getOldest returns the oldest entry
5353
func (l *LRU) getOldest() (key, value any) {
5454
if x := l.l.Back(); x != nil {
5555
if v, ok := x.Value.(*item); ok {
@@ -59,7 +59,7 @@ func (l *LRU) getOldest() (key, value any) {
5959
return
6060
}
6161

62-
// GetNewest returns the newest entry
62+
// getNewest returns the newest entry
6363
func (l *LRU) getNewest() (key, value any) {
6464
if x := l.l.Front(); x != nil {
6565
if v, ok := x.Value.(*item); ok {

connchecker/connchecker.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ func (c *Checker) initialCheck() error {
130130
return nil
131131
}
132132

133-
// ConnectionTest determines if a connection to the internet is available by
133+
// connectionTest determines if a connection to the internet is available by
134134
// iterating over a set list of dns ip and popular domains
135135
func (c *Checker) connectionTest() {
136136
for i := range c.DNSList {

currency/coinmarketcap/coinmarketcap_test.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,6 @@ const (
1515
apiAccountPlanLevel = ""
1616
)
1717

18-
// Checks credentials but also checks to see if the function can take the
19-
// required account plan level
2018
func areAPICredtionalsSet(minAllowable uint8) bool {
2119
if apiAccountPlanLevel != "" && apikey != "" {
2220
if err := c.CheckAccountPlan(minAllowable); err != nil {

dispatch/dispatch.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@ func (d *Dispatcher) publish(id uuid.UUID, data any) error {
227227
}
228228
}
229229

230-
// Subscribe subscribes a system and returns a communication chan, this does not ensure initial push.
230+
// subscribe subscribes a system and returns a communication chan, this does not ensure initial push
231231
func (d *Dispatcher) subscribe(id uuid.UUID) (chan any, error) {
232232
if err := common.NilGuard(d); err != nil {
233233
return nil, err
@@ -261,7 +261,7 @@ func (d *Dispatcher) subscribe(id uuid.UUID) (chan any, error) {
261261
return ch, nil
262262
}
263263

264-
// Unsubscribe unsubs a routine from the dispatcher.
264+
// unsubscribe unsubs a routine from the dispatcher
265265
func (d *Dispatcher) unsubscribe(id uuid.UUID, usedChan chan any) error {
266266
if err := common.NilGuard(d); err != nil {
267267
return err
@@ -314,7 +314,7 @@ func (d *Dispatcher) unsubscribe(id uuid.UUID, usedChan chan any) error {
314314
return errChannelNotFoundInUUIDRef
315315
}
316316

317-
// GetNewID returns a new ID.
317+
// getNewID returns a new ID
318318
func (d *Dispatcher) getNewID(genFn func() (uuid.UUID, error)) (uuid.UUID, error) {
319319
if err := common.NilGuard(d); err != nil {
320320
return uuid.Nil, err

engine/database_connection_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ func TestStartSQLite(t *testing.T) {
6767
assert.NoError(t, err)
6868
}
6969

70-
// This test does not care for a successful connection
70+
// TestStartPostgres does not require a successful connection
7171
func TestStartPostgres(t *testing.T) {
7272
m, err := SetupDatabaseConnectionManager(&database.Config{})
7373
assert.NoError(t, err)

engine/datahistory_manager.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1478,7 +1478,7 @@ func (m *DataHistoryManager) GenerateJobSummary(nickname string) (*DataHistoryJo
14781478
}, nil
14791479
}
14801480

1481-
// ----------------------------Lovely-converters----------------------------
1481+
// convertDBModelToJob converts a database model into a data history job
14821482
func (m *DataHistoryManager) convertDBModelToJob(dbModel *datahistoryjob.DataHistoryJob) (*DataHistoryJob, error) {
14831483
if !m.IsRunning() {
14841484
return nil, ErrSubSystemNotStarted

engine/datahistory_manager_test.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -739,7 +739,6 @@ func TestConverters(t *testing.T) {
739739
}
740740
}
741741

742-
// test helper functions
743742
func createDHM(t *testing.T) (*DataHistoryManager, *datahistoryjob.DataHistoryJob) {
744743
t.Helper()
745744
em := NewExchangeManager()

0 commit comments

Comments
 (0)