Skip to content

Commit ce1d685

Browse files
authored
docs: remove redundant method comments (#870)
1 parent c168c47 commit ce1d685

File tree

7 files changed

+312
-382
lines changed

7 files changed

+312
-382
lines changed

.golangci.yml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ issues:
2222
linters:
2323
enable:
2424
- gocyclo
25-
- godot
2625
- gofumpt
2726
- goimports
2827
- govet
@@ -35,7 +34,3 @@ linters-settings:
3534
extra-rules: true
3635
gocyclo:
3736
min-complexity: 20
38-
39-
godot:
40-
exclude:
41-
- "^\t+@[A-Za-z]+\t+"

pkg/controllers/account_v3.go

Lines changed: 48 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -244,25 +244,23 @@ func (co Controller) CreateAccountsV3(c *gin.Context) {
244244
c.JSON(status, r)
245245
}
246246

247-
// GetAccounts returns a list of all accounts matching the filter parameters
248-
//
249-
// @Summary List accounts
250-
// @Description Returns a list of accounts
251-
// @Tags Accounts
252-
// @Produce json
253-
// @Success 200 {object} AccountListResponseV3
254-
// @Failure 400 {object} AccountListResponseV3
255-
// @Failure 500 {object} AccountListResponseV3
256-
// @Router /v3/accounts [get]
257-
// @Param name query string false "Filter by name"
258-
// @Param note query string false "Filter by note"
259-
// @Param budget query string false "Filter by budget ID"
260-
// @Param onBudget query bool false "Is the account on-budget?"
261-
// @Param external query bool false "Is the account external?"
262-
// @Param hidden query bool false "Is the account hidden?"
263-
// @Param search query string false "Search for this text in name and note"
264-
// @Param offset query uint false "The offset of the first Transaction returned. Defaults to 0."
265-
// @Param limit query int false "Maximum number of transactions to return. Defaults to 50."
247+
// @Summary List accounts
248+
// @Description Returns a list of accounts
249+
// @Tags Accounts
250+
// @Produce json
251+
// @Success 200 {object} AccountListResponseV3
252+
// @Failure 400 {object} AccountListResponseV3
253+
// @Failure 500 {object} AccountListResponseV3
254+
// @Router /v3/accounts [get]
255+
// @Param name query string false "Filter by name"
256+
// @Param note query string false "Filter by note"
257+
// @Param budget query string false "Filter by budget ID"
258+
// @Param onBudget query bool false "Is the account on-budget?"
259+
// @Param external query bool false "Is the account external?"
260+
// @Param hidden query bool false "Is the account hidden?"
261+
// @Param search query string false "Search for this text in name and note"
262+
// @Param offset query uint false "The offset of the first Transaction returned. Defaults to 0."
263+
// @Param limit query int false "Maximum number of transactions to return. Defaults to 50."
266264
func (co Controller) GetAccountsV3(c *gin.Context) {
267265
var filter AccountQueryFilterV3
268266
if err := c.Bind(&filter); err != nil {
@@ -348,18 +346,16 @@ func (co Controller) GetAccountsV3(c *gin.Context) {
348346
})
349347
}
350348

351-
// GetAccount returns data for a specific account
352-
//
353-
// @Summary Get account
354-
// @Description Returns a specific account
355-
// @Tags Accounts
356-
// @Produce json
357-
// @Success 200 {object} AccountResponseV3
358-
// @Failure 400 {object} AccountResponseV3
359-
// @Failure 404 {object} AccountResponseV3
360-
// @Failure 500 {object} AccountResponseV3
361-
// @Param id path string true "ID formatted as string"
362-
// @Router /v3/accounts/{id} [get]
349+
// @Summary Get account
350+
// @Description Returns a specific account
351+
// @Tags Accounts
352+
// @Produce json
353+
// @Success 200 {object} AccountResponseV3
354+
// @Failure 400 {object} AccountResponseV3
355+
// @Failure 404 {object} AccountResponseV3
356+
// @Failure 500 {object} AccountResponseV3
357+
// @Param id path string true "ID formatted as string"
358+
// @Router /v3/accounts/{id} [get]
363359
func (co Controller) GetAccountV3(c *gin.Context) {
364360
id, err := httputil.UUIDFromString(c.Param("id"))
365361
if !err.Nil() {
@@ -382,19 +378,17 @@ func (co Controller) GetAccountV3(c *gin.Context) {
382378
c.JSON(http.StatusOK, AccountResponseV3{Data: &accountObject})
383379
}
384380

385-
// UpdateAccount updates data for a specific account
386-
//
387-
// @Summary Update account
388-
// @Description Updates an account. Only values to be updated need to be specified.
389-
// @Tags Accounts
390-
// @Produce json
391-
// @Success 200 {object} AccountResponseV3
392-
// @Failure 400 {object} AccountResponseV3
393-
// @Failure 404 {object} AccountResponseV3
394-
// @Failure 500 {object} AccountResponseV3
395-
// @Param id path string true "ID formatted as string"
396-
// @Param account body models.AccountCreate true "Account"
397-
// @Router /v3/accounts/{id} [patch]
381+
// @Summary Update account
382+
// @Description Updates an account. Only values to be updated need to be specified.
383+
// @Tags Accounts
384+
// @Produce json
385+
// @Success 200 {object} AccountResponseV3
386+
// @Failure 400 {object} AccountResponseV3
387+
// @Failure 404 {object} AccountResponseV3
388+
// @Failure 500 {object} AccountResponseV3
389+
// @Param id path string true "ID formatted as string"
390+
// @Param account body models.AccountCreate true "Account"
391+
// @Router /v3/accounts/{id} [patch]
398392
func (co Controller) UpdateAccountV3(c *gin.Context) {
399393
id, err := httputil.UUIDFromString(c.Param("id"))
400394
if !err.Nil() {
@@ -454,18 +448,16 @@ func (co Controller) UpdateAccountV3(c *gin.Context) {
454448
c.JSON(http.StatusOK, AccountResponseV3{Data: &accountObject})
455449
}
456450

457-
// DeleteAccount deletes an account
458-
//
459-
// @Summary Delete account
460-
// @Description Deletes an account
461-
// @Tags Accounts
462-
// @Produce json
463-
// @Success 204
464-
// @Failure 400 {object} httperrors.HTTPError
465-
// @Failure 404 {object} httperrors.HTTPError
466-
// @Failure 500 {object} httperrors.HTTPError
467-
// @Param id path string true "ID formatted as string"
468-
// @Router /v3/accounts/{id} [delete]
451+
// @Summary Delete account
452+
// @Description Deletes an account
453+
// @Tags Accounts
454+
// @Produce json
455+
// @Success 204
456+
// @Failure 400 {object} httperrors.HTTPError
457+
// @Failure 404 {object} httperrors.HTTPError
458+
// @Failure 500 {object} httperrors.HTTPError
459+
// @Param id path string true "ID formatted as string"
460+
// @Router /v3/accounts/{id} [delete]
469461
func (co Controller) DeleteAccountV3(c *gin.Context) {
470462
id, err := httputil.UUIDFromString(c.Param("id"))
471463
if !err.Nil() {

pkg/controllers/budget_v3.go

Lines changed: 66 additions & 80 deletions
Original file line numberDiff line numberDiff line change
@@ -103,28 +103,24 @@ func (co Controller) RegisterBudgetRoutesV3(r *gin.RouterGroup) {
103103
}
104104
}
105105

106-
// OptionsBudgetListV3 returns the allowed HTTP methods
107-
//
108-
// @Summary Allowed HTTP verbs
109-
// @Description Returns an empty response with the HTTP Header "allow" set to the allowed HTTP verbs
110-
// @Tags Budgets
111-
// @Success 204
112-
// @Router /v3/budgets [options]
106+
// @Summary Allowed HTTP verbs
107+
// @Description Returns an empty response with the HTTP Header "allow" set to the allowed HTTP verbs
108+
// @Tags Budgets
109+
// @Success 204
110+
// @Router /v3/budgets [options]
113111
func (co Controller) OptionsBudgetListV3(c *gin.Context) {
114112
httputil.OptionsGetPost(c)
115113
}
116114

117-
// OptionsBudgetDetailV3 returns the allowed HTTP methods
118-
//
119-
// @Summary Allowed HTTP verbs
120-
// @Description Returns an empty response with the HTTP Header "allow" set to the allowed HTTP verbs
121-
// @Tags Budgets
122-
// @Success 204
123-
// @Failure 400 {object} httperrors.HTTPError
124-
// @Failure 404 {object} httperrors.HTTPError
125-
// @Failure 500 {object} httperrors.HTTPError
126-
// @Param id path string true "ID formatted as string"
127-
// @Router /v3/budgets/{id} [options]
115+
// @Summary Allowed HTTP verbs
116+
// @Description Returns an empty response with the HTTP Header "allow" set to the allowed HTTP verbs
117+
// @Tags Budgets
118+
// @Success 204
119+
// @Failure 400 {object} httperrors.HTTPError
120+
// @Failure 404 {object} httperrors.HTTPError
121+
// @Failure 500 {object} httperrors.HTTPError
122+
// @Param id path string true "ID formatted as string"
123+
// @Router /v3/budgets/{id} [options]
128124
func (co Controller) OptionsBudgetDetailV3(c *gin.Context) {
129125
id, err := httputil.UUIDFromString(c.Param("id"))
130126
if !err.Nil() {
@@ -145,18 +141,16 @@ func (co Controller) OptionsBudgetDetailV3(c *gin.Context) {
145141
httputil.OptionsGetPatchDelete(c)
146142
}
147143

148-
// CreateBudgetV3 creates a new budget
149-
//
150-
// @Summary Create budget
151-
// @Description Creates a new budget
152-
// @Tags Budgets
153-
// @Accept json
154-
// @Produce json
155-
// @Success 201 {object} BudgetCreateResponseV3
156-
// @Failure 400 {object} BudgetCreateResponseV3
157-
// @Failure 500 {object} BudgetCreateResponseV3
158-
// @Param budget body models.BudgetCreate true "Budget"
159-
// @Router /v3/budgets [post]
144+
// @Summary Create budget
145+
// @Description Creates a new budget
146+
// @Tags Budgets
147+
// @Accept json
148+
// @Produce json
149+
// @Success 201 {object} BudgetCreateResponseV3
150+
// @Failure 400 {object} BudgetCreateResponseV3
151+
// @Failure 500 {object} BudgetCreateResponseV3
152+
// @Param budget body models.BudgetCreate true "Budget"
153+
// @Router /v3/budgets [post]
160154
func (co Controller) CreateBudgetsV3(c *gin.Context) {
161155
var budgets []models.BudgetCreate
162156

@@ -217,19 +211,17 @@ func (co Controller) CreateBudgetsV3(c *gin.Context) {
217211
c.JSON(status, r)
218212
}
219213

220-
// GetBudgetsV3 returns data for all budgets filtered by the query parameters
221-
//
222-
// @Summary List budgets
223-
// @Description Returns a list of budgets
224-
// @Tags Budgets
225-
// @Produce json
226-
// @Success 200 {object} BudgetListResponseV3
227-
// @Failure 500 {object} BudgetListResponseV3
228-
// @Router /v3/budgets [get]
229-
// @Param name query string false "Filter by name"
230-
// @Param note query string false "Filter by note"
231-
// @Param currency query string false "Filter by currency"
232-
// @Param search query string false "Search for this text in name and note"
214+
// @Summary List budgets
215+
// @Description Returns a list of budgets
216+
// @Tags Budgets
217+
// @Produce json
218+
// @Success 200 {object} BudgetListResponseV3
219+
// @Failure 500 {object} BudgetListResponseV3
220+
// @Router /v3/budgets [get]
221+
// @Param name query string false "Filter by name"
222+
// @Param note query string false "Filter by note"
223+
// @Param currency query string false "Filter by currency"
224+
// @Param search query string false "Search for this text in name and note"
233225
func (co Controller) GetBudgetsV3(c *gin.Context) {
234226
var filter BudgetQueryFilterV3
235227

@@ -308,18 +300,16 @@ func (co Controller) GetBudgetsV3(c *gin.Context) {
308300
})
309301
}
310302

311-
// GetBudgetV3 returns data for a single budget
312-
//
313-
// @Summary Get budget
314-
// @Description Returns a specific budget
315-
// @Tags Budgets
316-
// @Produce json
317-
// @Success 200 {object} BudgetResponseV3
318-
// @Failure 400 {object} BudgetResponseV3
319-
// @Failure 404 {object} BudgetResponseV3
320-
// @Failure 500 {object} BudgetResponseV3
321-
// @Param id path string true "ID formatted as string"
322-
// @Router /v3/budgets/{id} [get]
303+
// @Summary Get budget
304+
// @Description Returns a specific budget
305+
// @Tags Budgets
306+
// @Produce json
307+
// @Success 200 {object} BudgetResponseV3
308+
// @Failure 400 {object} BudgetResponseV3
309+
// @Failure 404 {object} BudgetResponseV3
310+
// @Failure 500 {object} BudgetResponseV3
311+
// @Param id path string true "ID formatted as string"
312+
// @Router /v3/budgets/{id} [get]
323313
func (co Controller) GetBudgetV3(c *gin.Context) {
324314
id, err := httputil.UUIDFromString(c.Param("id"))
325315
if !err.Nil() {
@@ -351,20 +341,18 @@ func (co Controller) GetBudgetV3(c *gin.Context) {
351341
c.JSON(http.StatusOK, BudgetResponseV3{Data: &r})
352342
}
353343

354-
// UpdateBudgetV3 updates data for a budget
355-
//
356-
// @Summary Update budget
357-
// @Description Update an existing budget. Only values to be updated need to be specified.
358-
// @Tags Budgets
359-
// @Accept json
360-
// @Produce json
361-
// @Success 200 {object} BudgetResponseV3
362-
// @Failure 400 {object} BudgetResponseV3
363-
// @Failure 404 {object} BudgetResponseV3
364-
// @Failure 500 {object} BudgetResponseV3
365-
// @Param id path string true "ID formatted as string"
366-
// @Param budget body models.BudgetCreate true "Budget"
367-
// @Router /v3/budgets/{id} [patch]
344+
// @Summary Update budget
345+
// @Description Update an existing budget. Only values to be updated need to be specified.
346+
// @Tags Budgets
347+
// @Accept json
348+
// @Produce json
349+
// @Success 200 {object} BudgetResponseV3
350+
// @Failure 400 {object} BudgetResponseV3
351+
// @Failure 404 {object} BudgetResponseV3
352+
// @Failure 500 {object} BudgetResponseV3
353+
// @Param id path string true "ID formatted as string"
354+
// @Param budget body models.BudgetCreate true "Budget"
355+
// @Router /v3/budgets/{id} [patch]
368356
func (co Controller) UpdateBudgetV3(c *gin.Context) {
369357
id, err := httputil.UUIDFromString(c.Param("id"))
370358
if !err.Nil() {
@@ -424,17 +412,15 @@ func (co Controller) UpdateBudgetV3(c *gin.Context) {
424412
c.JSON(http.StatusOK, BudgetResponseV3{Data: &r})
425413
}
426414

427-
// DeleteBudgetV3 deletes a budget
428-
//
429-
// @Summary Delete budget
430-
// @Description Deletes a budget
431-
// @Tags Budgets
432-
// @Success 204
433-
// @Failure 400 {object} httperrors.HTTPError
434-
// @Failure 404 {object} httperrors.HTTPError
435-
// @Failure 500 {object} httperrors.HTTPError
436-
// @Param id path string true "ID formatted as string"
437-
// @Router /v3/budgets/{id} [delete]
415+
// @Summary Delete budget
416+
// @Description Deletes a budget
417+
// @Tags Budgets
418+
// @Success 204
419+
// @Failure 400 {object} httperrors.HTTPError
420+
// @Failure 404 {object} httperrors.HTTPError
421+
// @Failure 500 {object} httperrors.HTTPError
422+
// @Param id path string true "ID formatted as string"
423+
// @Router /v3/budgets/{id} [delete]
438424
func (co Controller) DeleteBudgetV3(c *gin.Context) {
439425
id, err := httputil.UUIDFromString(c.Param("id"))
440426
if !err.Nil() {

pkg/controllers/cleanup_v3.go

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,14 @@ import (
88
"github.com/gin-gonic/gin"
99
)
1010

11-
// CleanupV3 permanently deletes all resources in the database
12-
//
13-
// @Summary Delete everything
14-
// @Description Permanently deletes all resources
15-
// @Tags v3
16-
// @Success 204
17-
// @Failure 400 {object} httperrors.HTTPError
18-
// @Failure 500 {object} httperrors.HTTPError
19-
// @Param confirm query string false "Confirmation to delete all resources. Must have the value 'yes-please-delete-everything'"
20-
// @Router /v3 [delete]
11+
// @Summary Delete everything
12+
// @Description Permanently deletes all resources
13+
// @Tags v3
14+
// @Success 204
15+
// @Failure 400 {object} httperrors.HTTPError
16+
// @Failure 500 {object} httperrors.HTTPError
17+
// @Param confirm query string false "Confirmation to delete all resources. Must have the value 'yes-please-delete-everything'"
18+
// @Router /v3 [delete]
2119
func (co Controller) CleanupV3(c *gin.Context) {
2220
var params struct {
2321
Confirm string `form:"confirm"`

0 commit comments

Comments
 (0)