-
Notifications
You must be signed in to change notification settings - Fork 69
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(linter): Upgrade and add some linters #1059
base: master
Are you sure you want to change the base?
Conversation
Codecov ReportAttention: Patch coverage is
❗ Your organization needs to install the Codecov GitHub app to enable full functionality. Additional details and impacted files@@ Coverage Diff @@
## master #1059 +/- ##
==========================================
- Coverage 67.92% 67.33% -0.59%
==========================================
Files 212 215 +3
Lines 12024 12407 +383
==========================================
+ Hits 8167 8354 +187
- Misses 3359 3527 +168
- Partials 498 526 +28 ☔ View full report in Codecov by Sentry. |
@@ -77,7 +77,10 @@ func getAllTriggers(writer http.ResponseWriter, request *http.Request) { | |||
func getUnusedTriggers(writer http.ResponseWriter, request *http.Request) { | |||
triggersList, errorResponse := controller.GetUnusedTriggerIDs(database) | |||
if errorResponse != nil { | |||
render.Render(writer, request, errorResponse) //nolint | |||
err := render.Render(writer, request, errorResponse) | |||
if err != nil { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
А какой в этом смысл? Может nolint с выключением конкретного линтера с комментом, если ругается на это
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
о, оно пофиксило за меня)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ну надо ее залогать по-хорошему будет и убрать нолинт будет
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
как варик
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Лайк логанью
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ну не в этом
этот итак жиробас, отдельно допинаю)
@@ -426,19 +425,19 @@ func CheckUserPermissionsForTeam( | |||
} | |||
|
|||
// GetTeamSettings gets team contacts and subscriptions. | |||
func GetTeamSettings(database moira.Database, teamID string) (dto.TeamSettings, *api.ErrorResponse) { | |||
func GetTeamSettings(dataBase moira.Database, teamID string) (dto.TeamSettings, *api.ErrorResponse) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
А почему так?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
есть пакет database - одинаковый нейминг)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Может назовём переменную db
или это ещё хуже?
@@ -73,7 +73,7 @@ type UserTeams struct { | |||
} | |||
|
|||
// Render is a function that implements chi Renderer interface for UserTeams. | |||
func (UserTeams) Render(w http.ResponseWriter, r *http.Request) error { | |||
func (UserTeams) Render(_ http.ResponseWriter, _ *http.Request) error { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
А почему не
func (UserTeams) Render(_ http.ResponseWriter, _ *http.Request) error { | |
func (UserTeams) Render(http.ResponseWriter, *http.Request) error { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
без разницы вообще
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
А почему не
А так вообще можно было 0_0
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
да
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Я просто подумал, что может лучше однотипно сделать везде и без лишних символов?
@@ -141,21 +141,21 @@ func (triggerMetrics TriggerMetrics) Populate(lastMetrics map[string]moira.Metri | |||
// { | |||
// "t3": {metrics}, | |||
// } | |||
func (triggerMetrics TriggerMetrics) FilterAloneMetrics(declaredAloneMetrics map[string]bool) (TriggerMetrics, AloneMetrics, error) { | |||
func (m TriggerMetrics) FilterAloneMetrics(declaredAloneMetrics map[string]bool) (TriggerMetrics, AloneMetrics, error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
А почему m
?
@@ -14,7 +14,7 @@ func updateFrom23(logger moira.Logger, dataBase moira.Database) error { | |||
return nil | |||
} | |||
|
|||
func downgradeTo23(logger moira.Logger, dataBase moira.Database) error { | |||
func downgradeTo23() error { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Может оставить хотя бы в виде сигнатуры, чтобы у всех методов переезда туда-сюда был одинаковый интерфейс?
func downgradeTo23() error { | |
func downgradeTo23(moira.Logger, moira.Database) error { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
В идеале ещё коммент о том, почему эта функция пустая
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
В идеале ещё коммент о том, почему эта функция пустая
какой?)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Я не знаю, так бы сразу написал 😅
Это какие-то технологии предков, 6 лет назад написан код
fix(linter): Upgrade and add some linters