-
Notifications
You must be signed in to change notification settings - Fork 49
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
Add golint to the linting process #58
Comments
Initial Patchset. This adds the |
New Related ChangeLink: https://review.opendev.org/710459 |
New Related ChangeLink: https://review.opendev.org/710454 |
New Related ChangeLink: https://review.opendev.org/710465 |
New Related ChangeLink: https://review.opendev.org/710462 |
New Related ChangeLink: https://review.opendev.org/710472 |
New Related ChangeLink: https://review.opendev.org/710471 |
New Related ChangeLink: https://review.opendev.org/710469 |
New Related ChangeLink: https://review.opendev.org/710468 |
Error strings by convention should not end in punctuation, or contain uppercase letters. Relates-To: #58 Change-Id: I027fb21a20f08fdd24cf654f3ae1cbceb3e5a6c6 Signed-off-by: Alexander Hughes <Alexander.Hughes@pm.me>
This patch resolves complaints from golint such as: cmd/config/set_authinfo_test.go:84:3: don't use leading k in Go names; pkg/remote/redfish/redfish.go:39:2: var systemId should be systemID pkg/remote/redfish/redfish.go:47:2: var managerId should be managerID pkg/remote/redfish/redfish.go:51:2: var vMediaId should be vMediaID pkg/remote/redfish/redfish.go:115:2: var parsedUrl should be parsedURL pkg/remote/redfish/utils.go:29:2: var trimmedUrl should be trimmedURL pkg/remote/redfish/utils.go:39:3: var rId should be rID Relates-To: #58 Change-Id: I758565c84b44aac118d5f1cbf714224ab1ff82c5 Signed-off-by: Alexander Hughes <Alexander.Hughes@pm.me>
This patch addresses golint errors such as: pkg/config/config.go:994:21: don't use leading k in Go names; func parameter kCluster should be cluster pkg/config/config.go:1003:21: don't use leading k in Go names; func parameter kContext should be context pkg/config/config.go:1012:22: don't use leading k in Go names; func parameter kAuthInfo should be authInfo pkg/remote/redfish/utils.go:49:6: func GetVirtualMediaId should be GetVirtualMediaID pkg/remote/redfish/utils.go:51:2: func parameter managerId should be managerID pkg/remote/redfish/utils.go:64:2: func parameter systemId should be systemID pkg/remote/redfish/utils.go:87:67: func parameter systemId should be systemID pkg/remote/redfish/utils.go:108:2: func parameter managerId should be managerID pkg/remote/redfish/utils.go:109:2: func parameter vMediaId should be vMediaID Relates-To: #58 Change-Id: I231becdb19fa962e888df46ef1a6b66e64d32e72 Signed-off-by: Alexander Hughes <Alexander.Hughes@pm.me>
This patch addresses golint failures such as: pkg/bootstrap/isogen/command_test.go:24:2: struct field getId should be getID pkg/config/types.go:83:2: don't use leading k in Go names; struct field kCluster should be cluster pkg/config/types.go:108:2: don't use leading k in Go names; struct field kContext should be context pkg/config/types.go:113:2: don't use leading k in Go names; struct field kAuthInfo should be authInfo pkg/container/container_docker.go:79:2: struct field imageUrl should be imageURL pkg/container/container_docker_test.go:427:3: struct field imageUrl should be imageURL pkg/remote/redfish/redfish.go:23:2: struct field EphemeralNodeId should be EphemeralNodeID pkg/remote/redfish/redfish.go:29:2: struct field Api should be API Relates-To: #58 Change-Id: Ie8d1c49c9d392f10be0f38224c98b588a9e2a544 Signed-off-by: Alexander Hughes <Alexander.Hughes@pm.me>
This patch addresses golint failures such as: pkg/bootstrap/isogen/command_test.go:43:26: method GetId should be GetID pkg/container/container_docker.go:171:27: method getImageId should be getImageID pkg/container/container_docker.go:193:27: method GetId should be GetID Relates-To: #58 Change-Id: I7eb461387524f23a89bc2ae7ce59dac066c12281 Signed-off-by: Alexander Hughes <Alexander.Hughes@pm.me>
This patch addresses golint failures such as: pkg/config/constants.go:21:2: const AirshipConfigApiVersion should be AirshipConfigAPIVersion Relates-To: #58 Change-Id: I164c907957c8b760c64737c48995f5f3c0d297ec Signed-off-by: Alexander Hughes <Alexander.Hughes@pm.me>
This patch addresses golint failures such as: pkg/config/repo.go:35:1: receiver name r should be consistent with previous receiver name c for RepoCheckout pkg/config/repo.go:76:1: receiver name r should be consistent with previous receiver name auth for RepoAuth pkg/config/repo.go:127:1: receiver name r should be consistent with previous receiver name repo for Repository pkg/config/repo.go:135:1: receiver name spec should be consistent with previous receiver name repo for Repository Relates-To: #58 Change-Id: I5f7eec779ee6438cb290a9f82febef74a7ea8123 Signed-off-by: Alexander Hughes <Alexander.Hughes@pm.me>
This patch addresses guidance from effective go [0] and golint failures such as: pkg/document/document.go:8:6: type name will be used as document.DocumentFactory by other packages, and that stutters; consider calling this Factory pkg/remote/errors.go:9:6: type name will be used as remote.RemoteDirectError by other packages, and that stutters; consider calling this DirectError pkg/remote/remote_direct.go:27:6: type name will be used as remote.RemoteDirectClient by other packages, and that stutters; consider calling this DirectClient pkg/remote/redfish/errors.go:10:6: type name will be used as redfish.RedfishClientError by other packages, and that stutters; consider calling this ClientError pkg/remote/redfish/redfish.go:14:6: type name will be used as redfish.RedfishRemoteDirect by other packages, and that stutters; consider calling this RemoteDirect [0] https://golang.org/doc/effective_go.html#package-names Relates-To: #58 Change-Id: I6d94da7755c8719bbcc4a77917e283074281309a Signed-off-by: Alexander Hughes <Alexander.Hughes@pm.me>
This adds the golint linter to the `make lint` target. As of this commit, the results from golint are not counted as errors. Further changes to the code will be required to bring it up to golint's standards, at which point we will allow golint to cause failures for the `lint` target. Change-Id: I34134e3deb080e6da0bc0aac299caca6c3b5d0a9
Depends-On: #40
Problem description (if applicable)
Issue #40 aims to improve the code documentation of packages, structs, and functions. This issue suggests a solution for maintaining high quality documentation as
airshipctl
continues through development.Proposed change
We should include
golint
in our suite of linters. Thegolint
linter aims to match the accepted style of the open source Go project, specifically those style suggestions from Effective Go and the CodeReviewComments wiki page.Potential impacts
The
golint
tool will include style suggestions that exceed the goals of this issue. These suggestions can not be adjusted - we must adhere to all of its suggestions. This will probably result in an overall healthier codebase, but may have undesirable side-effects.The text was updated successfully, but these errors were encountered: