fix(wakatime)!: rename Cummulative to Cumulative

This commit is contained in:
Janrey Licas 2023-03-11 17:05:29 +08:00 committed by GitHub
parent b0b34fc90e
commit e438c8d61e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 8 additions and 9 deletions

View file

@ -21,13 +21,13 @@ type wtTotals struct {
}
type wtData struct {
CummulativeTotal wtTotals `json:"cummulative_total"`
Start string `json:"start"`
End string `json:"end"`
CumulativeTotal wtTotals `json:"cumulative_total"`
Start string `json:"start"`
End string `json:"end"`
}
func (w *Wakatime) Template() string {
return " {{ secondsRound .CummulativeTotal.Seconds }} "
return " {{ secondsRound .CumulativeTotal.Seconds }} "
}
func (w *Wakatime) Enabled() bool {

View file

@ -73,8 +73,7 @@ func TestWTTrackedTime(t *testing.T) {
for _, tc := range cases {
env := &mock.MockedEnvironment{}
response := fmt.Sprintf(`{"cummulative_total": {"seconds": %.2f, "text": "x"}}`, float64(tc.Seconds))
response := fmt.Sprintf(`{"cumulative_total": {"seconds": %.2f, "text": "x"}}`, float64(tc.Seconds))
env.On("HTTPRequest", FAKEAPIURL).Return([]byte(response), tc.Error)

View file

@ -53,7 +53,7 @@ If you don't want to include the API key into your configuration, the following
}
```
:::note
:::note
`WAKATIME_API_KEY` is an example, **any name is possible and acceptable** as long as the environment variable exists and contains the API key value.
@ -66,7 +66,7 @@ Please refer to the [Environment Variable][templates-environment-variables] page
:::note default template
```template
{{ secondsRound .CummulativeTotal.Seconds }}
{{ secondsRound .CumulativeTotal.Seconds }}
```
:::
@ -75,7 +75,7 @@ Please refer to the [Environment Variable][templates-environment-variables] page
| Name | Type | Description |
| ------------------- | ---------- | ---------------------------------------- |
| `.CummulativeTotal` | `wtTotals` | object holding total tracked time values |
| `.CumulativeTotal` | `wtTotals` | object holding total tracked time values |
### wtTotals Properties