Skip to content

Commit 02c76f5

Browse files
codespell: Automate detection of more words and fix spelling issues (thrasher-corp#2172)
* codespell: Automate detection of more words and fix spelling issues * refactor(tests): Improve comments for websocket stream key test and remove redundant lines * codespell: Add missing newline at end of .codespellrc file * Update contrib/spellcheck/codespell_custom_dictionary.txt Co-authored-by: Scott <gloriousCode@users.noreply.github.com> * fix: update comments for consistency in British English spelling and improve clarity - Changed "behavior" to "behaviour" in multiple comments across various files. - Updated "canceled" to "cancelled" in documentation and comments for consistency. - Improved comment clarity by rephrasing and ensuring self-explanatory language. --------- Co-authored-by: Scott <gloriousCode@users.noreply.github.com>
1 parent 23eb144 commit 02c76f5

File tree

88 files changed

+3016
-4745
lines changed

Some content is hidden

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

88 files changed

+3016
-4745
lines changed

.codespellrc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
[codespell]
2-
skip = ./.git,./web,./currency/code_types.go,*.json,*.sum,*.html,./vendor
2+
skip = ./.git,./web,./currency/code_types.go,*.json,*.sum,*.html,./vendor,./contrib/spellcheck/codespell_custom_dictionary.txt
33
exclude-file = ./contrib/spellcheck/exclude_lines.txt
44
ignore-words = ./contrib/spellcheck/ignore_words.txt
55
ignore-regex = currency\.\w+
6+
dictionary = ./contrib/spellcheck/codespell_custom_dictionary.txt,-

.github/workflows/spell-checker.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,5 @@ jobs:
77
steps:
88
- uses: actions/checkout@v6
99
- uses: codespell-project/actions-codespell@master
10+
with:
11+
args: --dictionary=-,./contrib/spellcheck/codespell_custom_dictionary.txt

cmd/documentation/exchanges_templates/orders.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
- Deletion of order
88
- Order tracking
99

10-
+ For futures orders, this package also contains a futures position controller. It is responsible for tracking all futures orders that GoCryptoTrader processes. It keeps a running history of realised and unreaslied PNL to allow a trader to track their profits. Positions are closed once the exposure reaches zero, then upon a new futures order being processed, a new position is created. To view futures positions, see the GRPC command `getfuturesposition`
10+
+ For futures orders, this package also contains a futures position controller. It is responsible for tracking all futures orders that GoCryptoTrader processes. It keeps a running history of realised and unrealised PNL to allow a trader to track their profits. Positions are closed once the exposure reaches zero, then upon a new futures order being processed, a new position is created. To view futures positions, see the GRPC command `getfuturesposition`
1111

1212
{{template "donations" .}}
1313
{{end}}

cmd/documentation/exchanges_templates/validate.tmpl

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@ type Critical struct {
2121
}
2222
2323
// define validation and add a variadic param
24-
func (supercritcalinfo *Critical) Validate(opt ...validate.Checker) error {
24+
func (superCriticalInfo *Critical) Validate(opt ...validate.Checker) error {
2525
// define base level validation
26-
if supercritcalinfo != nil {
26+
if superCriticalInfo != nil {
2727
// oh no this is nil, could panic program!
2828
}
2929
@@ -44,10 +44,10 @@ func (supercritcalinfo *Critical) Validate(opt ...validate.Checker) error {
4444
4545
// define an exchange or package level check that returns a validate.Checker
4646
// interface
47-
func (supercritcalinfo *Critical) PleaseDontSendMoneyToParents() validate.Checker {
47+
func (superCriticalInfo *Critical) PleaseDontSendMoneyToParents() validate.Checker {
4848
return validate.Check(func() error {
49-
if supercritcalinfo.Person == "Mother Dearest" ||
50-
supercritcalinfo.Person == "Father Dearest" {
49+
if superCriticalInfo.Person == "Mother Dearest" ||
50+
superCriticalInfo.Person == "Father Dearest" {
5151
return errors.New("nope")
5252
}
5353
return nil

cmd/gctcli/commands.go

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2749,7 +2749,7 @@ var withdrawalRequestCommand = &cli.Command{
27492749
Usage: "withdrawal id",
27502750
},
27512751
},
2752-
Action: withdrawlRequestByID,
2752+
Action: withdrawalRequestByID,
27532753
},
27542754
{
27552755
Name: "byexchangeid",
@@ -2765,7 +2765,7 @@ var withdrawalRequestCommand = &cli.Command{
27652765
Usage: "withdrawal id",
27662766
},
27672767
},
2768-
Action: withdrawlRequestByExchangeID,
2768+
Action: withdrawalRequestByExchangeID,
27692769
},
27702770
{
27712771
Name: "byexchange",
@@ -2789,7 +2789,7 @@ var withdrawalRequestCommand = &cli.Command{
27892789
Usage: "the asset type of the currency pair",
27902790
},
27912791
},
2792-
Action: withdrawlRequestByExchangeID,
2792+
Action: withdrawalRequestByExchangeID,
27932793
},
27942794
{
27952795
Name: "bydate",
@@ -2817,12 +2817,12 @@ var withdrawalRequestCommand = &cli.Command{
28172817
Usage: "max number of withdrawals to return",
28182818
},
28192819
},
2820-
Action: withdrawlRequestByDate,
2820+
Action: withdrawalRequestByDate,
28212821
},
28222822
},
28232823
}
28242824

2825-
func withdrawlRequestByID(c *cli.Context) error {
2825+
func withdrawalRequestByID(c *cli.Context) error {
28262826
if c.NArg() == 0 && c.NumFlags() == 0 {
28272827
return cli.ShowSubcommandHelp(c)
28282828
}
@@ -2858,7 +2858,7 @@ func withdrawlRequestByID(c *cli.Context) error {
28582858
return nil
28592859
}
28602860

2861-
func withdrawlRequestByExchangeID(c *cli.Context) error {
2861+
func withdrawalRequestByExchangeID(c *cli.Context) error {
28622862
if c.NArg() == 0 && c.NumFlags() == 0 {
28632863
return cli.ShowSubcommandHelp(c)
28642864
}
@@ -2935,7 +2935,7 @@ func withdrawlRequestByExchangeID(c *cli.Context) error {
29352935
return nil
29362936
}
29372937

2938-
func withdrawlRequestByDate(c *cli.Context) error {
2938+
func withdrawalRequestByDate(c *cli.Context) error {
29392939
if c.NArg() == 0 && c.NumFlags() == 0 {
29402940
return cli.ShowSubcommandHelp(c)
29412941
}

cmd/gctcli/websocket_management.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ var websocketManagerCommand = &cli.Command{
6969
},
7070
&cli.StringFlag{
7171
Name: "proxy",
72-
Usage: "proxy address to change to, if proxy string is not set, this will stop the utilization of the prior set proxy.",
72+
Usage: "proxy address to change to, if proxy string is not set, this will stop the utilisation of the prior set proxy.",
7373
},
7474
},
7575
Action: setProxy,

common/common.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ func NilGuard(ptrs ...any) (errs error) {
9292
Obviously can't compare to nil, since the types won't match, so we look into the interface
9393
eface is the internal representation of any; e(mpty-inter)face
9494
See: https://cs.opensource.google/go/go/+/refs/tags/go1.24.1:src/runtime/runtime2.go;l=184-187
95-
We optimize here by converting to [2]uintptr and just checking the address, instead of casting to a local eface type
95+
We optimise here by converting to [2]uintptr and just checking the address, instead of casting to a local eface type
9696
*/
9797
if (*[2]uintptr)(unsafe.Pointer(&p))[1] == 0 {
9898
errs = AppendError(errs, fmt.Errorf("%w: %T", ErrNilPointer, p))
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
accetable->acceptable
2+
adresstag->addresstag
3+
affilate->affiliate
4+
authentecated->authenticated
5+
behavior->behaviour
6+
bifinex->bitfinex
7+
canceled->cancelled
8+
candlesctick->candlestick
9+
critcalbankingstuff->criticalbankingstuff
10+
crypo->crypto
11+
cummulative->cumulative
12+
curency->currency
13+
customize->customise
14+
customized->customised
15+
customizes->customises
16+
decerialize->deserialise
17+
decerialized->deserialised
18+
decerializing->deserialising
19+
deserialize->deserialise
20+
deserialized->deserialised
21+
deserializes->deserialises
22+
deserializing->deserialising
23+
favor->favour
24+
generalized->generalised
25+
indivudal->individual
26+
lenging->lending
27+
liquidiation->liquidation
28+
minimize->minimise
29+
minimized->minimised
30+
minimizes->minimises
31+
mmethod->method
32+
openinig->opening
33+
optimize->optimise
34+
optimized->optimised
35+
optimization->optimisation
36+
optimizes->optimises
37+
organize->organise
38+
organized->organised
39+
overrided->overridden
40+
recieve->receive
41+
referal->referral
42+
relationl->relational
43+
retrive->retrieve
44+
serialize->serialise
45+
serialized->serialised
46+
serializes->serialises
47+
serializing->serialising
48+
serparated->separated
49+
snapshooooot->snapshot
50+
sream->stream
51+
suabccount->subaccount
52+
subrcribe->subscribe
53+
summarize->summarise
54+
summarized->summarised
55+
supercritcalinfo->superCriticalInfo
56+
susbsytems->subsystems
57+
umarshal->unmarshal
58+
unreaslied->unrealised
59+
utilize->utilise
60+
utilized->utilised
61+
utilization->utilisation
62+
utilizing->utilising
63+
withdaw->withdraw
64+
withdrawl->withdrawal

contrib/spellcheck/exclude_lines.txt

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,41 @@
1313
currency.SHFT: 84,
1414
TotalIn float64 `json:"totalIn"`
1515
TotalIn int64 `json:"totalIn"`
16+
behavior: default
17+
loanCustomiseMarginCall = "/sapi/v1/loan/customize/margin_call"
18+
assert.ErrorIs(t, b.StartPortfolioWatcher(ctx, 0), context.Canceled, "StartPortfolioWatcher should return context.Canceled")
19+
assert.ErrorIs(t, <-doneCh, context.Canceled, "StartPortfolioWatcher should return a context cancelled error")
20+
{Case: "CANCELED", Result: order.Cancelled},
21+
case "CANCELED":
22+
if algoOrderID == "" && !slices.Contains([]string{"effective", "order_failed", "canceled"}, state) {
23+
// GetCompletedSpreadOrdersLast7Days retrieve the completed order data for the last 7 days, and the incomplete orders (filledSz =0 & state = canceled) that have been cancelled are only reserved for 2 hours. Results are returned in counter chronological order
24+
"70200": errors.New("the RFQ with {0} status cannot be canceled"),
25+
"70400": errors.New("the quote with {0} status cannot be canceled"),
26+
"58220": errors.New("the withdrawal order is already canceled"),
27+
"51401": errors.New("cancellation failed as the order is already canceled"),
28+
"51406": errors.New("canceled - order count exceeds the limit {0}"),
29+
"51509": errors.New("modification failed as the order has been canceled"),
30+
result, err := e.GetCompletedSpreadOrdersLast7Days(contextGenerate(), "", "limit", "canceled", "", "", time.Time{}, time.Time{}, 10)
31+
{Case: "canceled", Result: order.Cancelled},
32+
case "canceled":
33+
states := "partial-canceled,filled,canceled"
34+
require.ErrorIs(t, err, context.Canceled)
35+
case "CANCELED", "CANCELLED":
36+
"status": "canceled",
37+
"reportType": "canceled"
38+
Status string `json:"status"` // new, suspended, partiallyFilled, filled, canceled, expired
39+
case "replaced", "canceled", "new":
40+
o.Status = strings.Replace(o.Status, "canceled", "cancelled", 1)
41+
if resp[i].Status != "canceled" {
42+
"CANCELED": order.Cancelled,
43+
Status: "CANCELED",
44+
case PartiallyCancelled.String(), "PARTIAL-CANCELED", "PARTIALLY CANCELLED", "ORDER_PARTIALLY_TRANSACTED":
45+
case Cancelled.String(), "CANCELED", "ORDER_CANCELLED":
46+
assert.ErrorIs(t, err, context.Canceled, "should return correct error when context is cancelled")
47+
require.ErrorIs(t, err, context.Canceled, "must return error when context is cancelled")
48+
Type string `json:"type"` // Message Type: "open", "match", "filled", "canceled", "update"
49+
case "partial-canceled":
50+
{Case: "partial-canceled", Result: order.PartiallyCancelled},
51+
withdrawal := []byte(`[13293039,"ETH","ETHEREUM",null,null,1574175052000,1574181326000,null,null,"CANCELED",null,null,-0.24,-0.00135,null,null,"DESTINATION_ADDRESS",null,null,null,"TRANSACTION_ID","Purchase of 100 pizzas"]`)
52+
pressXToJSON = `[0,"oc",[34930659963,null,1574955083558,"tETHUSD",1574955083558,1574955354487,0.201104,0.201104,"EXCHANGE LIMIT",null,null,null,0,"CANCELED",null,null,120,0,0,0,null,null,null,0,0,null,null,null,"BFX",null,null,null]]`
53+
"Quotes": `{"arg": {"channel":"quotes"},"data":[{"validUntil":"1608997227854","uTime":"1608267227834","cTime":"1608267227834","legs":[{"px":"0.0023","sz":"25.0","instId":"BTC-USD-220114-25000-C","side":"sell","tgtCcy":""},{"px":"0.0045","sz":"25","instId":"BTC-USD-220114-35000-C","side":"buy","tgtCcy":""}],"quoteId":"25092","rfqId":"18753","traderCode":"SATS","quoteSide":"sell","state":"canceled","clQuoteId":""}]}`,

contrib/spellcheck/ignore_words.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@ prevend
44
flate
55
zar
66
insid
7-
totalin
7+
totalin

0 commit comments

Comments
 (0)