cli icon indicating copy to clipboard operation
cli copied to clipboard

fix lint errors

Open metskem opened this issue 3 years ago • 5 comments

Please fill out the issue checklist below and provide ALL the requested information.

  • [x ] I reviewed open and closed github issues that may be related to my problem.
  • [x ] I tried updating to the latest version of the CF CLI to see if it fixed my problem.
  • [ ] I attempted to run the command with CF_TRACE=1 to help debug the issue.
  • [x ] I am reporting a bug that others will be able to reproduce.

Describe the bug and the command you saw an issue with I just started checking out the cf-cli source, and wanted to first build the master branch without making any changes. But that failed on a couple of lint errors.

I created a local branch and fixed the errors. Do you want a PR?

What happened I ran "make", which runs the lint make target. That target failed with several lint errors (imports ordering/grouping, redundant null check, unhandled errors)

Expected behavior I expect the master branch of a project not to have such (lint) errors.

Exact Steps To Reproduce

  • cd into the project
  • run "make" or "make lint"

Provide more context I did the test on the master branch

Notes regarding V6 and V7 CLI support: N/A

metskem avatar Jan 24 '22 18:01 metskem

Can you please provide additional context about your environment? It would be helpful to know what version of go lang you are using and the exact error messages.

a-b avatar Jan 24 '22 18:01 a-b

My golang version is "go version go1.16.3 darwin/amd64". And I am getting the following lint errors (running "make lint":

Running custom linters...
bash -c "go run bin/style/main.go api util"
util/ui/ui.go +292 method UI.DisplayDiffAddition defined after function getIndent
util/ui/ui.go +313 method UI.DisplayDiffRemoval defined after function getIndent
util/ui/ui.go +334 method UI.DisplayDiffUnchanged defined after function getIndent
util/ui/ui.go +355 method UI.DisplayJSON defined after function getIndent
util/ui/ui.go +380 method UI.FlushDeferred defined after function getIndent
util/ui/ui.go +391 method UI.GetErr defined after function getIndent
util/ui/ui.go +396 method UI.GetIn defined after function getIndent
util/ui/ui.go +401 method UI.GetOut defined after function getIndent
util/ui/ui.go +408 method UI.TranslateText defined after function getIndent
util/ui/ui.go +413 method UI.UserFriendlyDate defined after function getIndent
util/ui/ui.go +418 method UI.Writer defined after function getIndent
util/ui/ui.go +422 method UI.displayWrappingTableWithWidth defined after function getIndent
util/ui/ui.go +479 method UI.modifyColor defined after function getIndent
exit status 1
make: *** [custom-lint] Error 1

metskem avatar Jan 24 '22 18:01 metskem

Thanks for the context. I was able to reproduce it with go version go1.17.6 linux/amd64. We are working on a new Github Actions-based pipeline and we are expecting better linting very soon.

a-b avatar Jan 24 '22 18:01 a-b

Also, we are very open to PR's if you are interested in contributing.

a-b avatar Jan 24 '22 19:01 a-b

https://github.com/cloudfoundry/cli/pull/2246

metskem avatar Jan 24 '22 19:01 metskem

lint errors were fixed, closing

moleske avatar Jan 13 '24 01:01 moleske