qa/spelling: Add Codespell support (#1121)

* Add codespell support

* Fix paths

* Add HTML files to exclusion list
This commit is contained in:
Adrian Gallagher
2023-01-30 12:36:56 +11:00
committed by GitHub
parent c785ae73a7
commit a79e0d2b3e
108 changed files with 359 additions and 318 deletions

View File

@@ -584,7 +584,7 @@ func (h *HUOBI) GetSwapOrderLimitInfo(ctx context.Context, code currency.Pair, o
}
req["contract_code"] = codeValue
if !common.StringDataCompareInsensitive(validOrderTypes, orderType) {
return resp, fmt.Errorf("inavlid ordertype provided")
return resp, fmt.Errorf("invalid ordertype provided")
}
req["order_price_type"] = orderType
return resp, h.FuturesAuthenticatedHTTPRequest(ctx, exchange.RestFutures, http.MethodPost, huobiSwapOrderLimitInfo, nil, req, &resp)
@@ -638,7 +638,7 @@ func (h *HUOBI) AccountTransferData(ctx context.Context, code currency.Pair, sub
req["subUid"] = subUID
req["amount"] = amount
if !common.StringDataCompareInsensitive(validTransferType, transferType) {
return resp, fmt.Errorf("inavlid transferType received")
return resp, fmt.Errorf("invalid transferType received")
}
req["type"] = transferType
return resp, h.FuturesAuthenticatedHTTPRequest(ctx, exchange.RestFutures, http.MethodPost, huobiSwapInternalTransferData, nil, req, &resp)
@@ -654,7 +654,7 @@ func (h *HUOBI) AccountTransferRecords(ctx context.Context, code currency.Pair,
}
req["contract_code"] = codeValue
if !common.StringDataCompareInsensitive(validTransferType, transferType) {
return resp, fmt.Errorf("inavlid transferType received")
return resp, fmt.Errorf("invalid transferType received")
}
req["type"] = transferType
if createDate > 90 {
@@ -685,7 +685,7 @@ func (h *HUOBI) PlaceSwapOrders(ctx context.Context, code currency.Pair, clientO
req["direction"] = direction
req["offset"] = offset
if !common.StringDataCompareInsensitive(validOrderTypes, orderPriceType) {
return resp, fmt.Errorf("inavlid ordertype provided")
return resp, fmt.Errorf("invalid ordertype provided")
}
req["order_price_type"] = orderPriceType
req["price"] = price

View File

@@ -660,7 +660,7 @@ func (h *HUOBI) FTransfer(ctx context.Context, subUID, symbol, transferType stri
req["subUid"] = subUID
req["amount"] = amount
if !common.StringDataCompareInsensitive(validTransferType, transferType) {
return resp, fmt.Errorf("inavlid transferType received")
return resp, fmt.Errorf("invalid transferType received")
}
req["type"] = transferType
return resp, h.FuturesAuthenticatedHTTPRequest(ctx, exchange.RestFutures, http.MethodPost, fTransfer, nil, req, &resp)
@@ -674,7 +674,7 @@ func (h *HUOBI) FGetTransferRecords(ctx context.Context, symbol, transferType st
req["symbol"] = symbol
}
if !common.StringDataCompareInsensitive(validTransferType, transferType) {
return resp, fmt.Errorf("inavlid transferType received")
return resp, fmt.Errorf("invalid transferType received")
}
req["type"] = transferType
if createDate < 0 || createDate > 90 {

View File

@@ -683,7 +683,7 @@ func TestUpdateTickerSpot(t *testing.T) {
t.Parallel()
_, err := h.UpdateTicker(context.Background(), currency.NewPairWithDelimiter("INV", "ALID", "-"), asset.Spot)
if err == nil {
t.Error("exepcted invalid pair")
t.Error("expected invalid pair")
}
_, err = h.UpdateTicker(context.Background(), currency.NewPairWithDelimiter("BTC", "USDT", "_"), asset.Spot)
if err != nil {
@@ -695,7 +695,7 @@ func TestUpdateTickerCMF(t *testing.T) {
t.Parallel()
_, err := h.UpdateTicker(context.Background(), currency.NewPairWithDelimiter("INV", "ALID", "_"), asset.CoinMarginedFutures)
if err == nil {
t.Error("exepcted invalid contract code")
t.Error("expected invalid contract code")
}
_, err = h.UpdateTicker(context.Background(), currency.NewPairWithDelimiter("BTC", "USD", "_"), asset.CoinMarginedFutures)
if err != nil {
@@ -2553,7 +2553,7 @@ func TestStringToOrderStatus(t *testing.T) {
for i := range testCases {
result, _ := stringToOrderStatus(testCases[i].Case)
if result != testCases[i].Result {
t.Errorf("Exepcted: %v, received: %v", testCases[i].Result, result)
t.Errorf("Expected: %v, received: %v", testCases[i].Result, result)
}
}
}
@@ -2571,7 +2571,7 @@ func TestStringToOrderSide(t *testing.T) {
for i := range testCases {
result, _ := stringToOrderSide(testCases[i].Case)
if result != testCases[i].Result {
t.Errorf("Exepcted: %v, received: %v", testCases[i].Result, result)
t.Errorf("Expected: %v, received: %v", testCases[i].Result, result)
}
}
}
@@ -2589,7 +2589,7 @@ func TestStringToOrderType(t *testing.T) {
for i := range testCases {
result, _ := stringToOrderType(testCases[i].Case)
if result != testCases[i].Result {
t.Errorf("Exepcted: %v, received: %v", testCases[i].Result, result)
t.Errorf("Expected: %v, received: %v", testCases[i].Result, result)
}
}
}