pmm icon indicating copy to clipboard operation
pmm copied to clipboard

Enable `tagliatelle` linter rule

Open ademidoff opened this issue 1 year ago • 5 comments

Description

Ref: #1541 We'd like to enable tagliatelle linter rule.

Suggested solution

  • evaluate if we can afford to enable the rule
  • if yes, fix all linter error to make tests pass
  • if not, disable the rule and leave a comment explaining why (subject to review by the dev team)

Additional context

The rule can be enabled by simply removing this line. You can check similar PRs to see how we enabled some other rules (ref: #1541)

Code of Conduct

  • [X] I agree to follow this project's Code of Conduct

ademidoff avatar Jul 03 '23 14:07 ademidoff

Hi @artemgavrilov i enabled the tagliatelle linter and checked for the linter warnings i did not find any warning on tagliatelle but got these managed/utils/platform/client.go:286:67: directive //nolint:tagliatelle is unused for linter "tagliatelle" (nolintlint)    GrafanaClientID        string json:"grafana_client_id"         //nolint:tagliatelle                                                                     ^managed/utils/platform/client.go:287:67: directive //nolint:tagliatelle is unused for linter "tagliatelle" (nolintlint)    PMMManagedClientID     string json:"pmm_managed_client_id"     //nolint:tagliatelle                                                                     ^managed/utils/platform/client.go:288:67: directive //nolint:tagliatelle is unused for linter "tagliatelle" (nolintlint)    PMMManagedClientSecret string json:"pmm_managed_client_secret" //nolint:tagliatelle

will these be counted as linter warning for tagliatelle ?

vishwas-sharma2480 avatar Sep 11 '23 22:09 vishwas-sharma2480

HI @BupycHuk @atymchuk and @artemgavrilov any update on above or should raise a PR with linter rule enabled ?

vishwas-sharma2480 avatar Sep 12 '23 23:09 vishwas-sharma2480

Hi @vishwas-sharma2480, yeah those seems like a valid warnings. please remove //nolint directives for them. Thank you

BupycHuk avatar Sep 13 '23 23:09 BupycHuk

Hi @BupycHuk I tried resolving the warnings as suggested but i got this new warning instead managed/utils/platform/client.go:286: File is not gci-ed with --skip-generated -s standard -s default -s prefix(github.com/percona/pmm) (gci)     GrafanaClientID        string json:"grafana_client_id"             PMMManagedClientID     string json:"pmm_managed_client_id"       PMMManagedClientSecret string json:"pmm_managed_client_secret"

vishwas-sharma2480 avatar Sep 18 '23 23:09 vishwas-sharma2480

Hi @BupycHuk I tried resolving the warnings as suggested but i got this new warning instead managed/utils/platform/client.go:286: File is not gci-ed with --skip-generated -s standard -s default -s prefix(github.com/percona/pmm) (gci) GrafanaClientID string json:"grafana_client_id" PMMManagedClientID string json:"pmm_managed_client_id" PMMManagedClientSecret string json:"pmm_managed_client_secret"

Use make format command, it will properly format sources. P.S. before use make init to install required tools.

artemgavrilov avatar Sep 19 '23 10:09 artemgavrilov