fix lint errors
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=1to 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
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.
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
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.
Also, we are very open to PR's if you are interested in contributing.
https://github.com/cloudfoundry/cli/pull/2246
lint errors were fixed, closing