-
Notifications
You must be signed in to change notification settings - Fork 819
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
Feature/gometalinter #176
Feature/gometalinter #176
Conversation
Build Succeeded 👏 Build Id: c2825c28-7857-4e75-8bd3-56d693c958ae The following development artifacts have been built, and will exist for the next 30 days:
|
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.
👍 some comment/thoughts on changes - but so happy to see this in place!!!!
I can see it already picked up on stuff I particularly missed, just using gometalinter manually.
build/Makefile
Outdated
@@ -127,10 +127,15 @@ install: ensure-build-image | |||
agones $(mount_path)/install/helm/agones/ | |||
|
|||
# Build a static binary for the gameserver controller | |||
build-controller-binary: ensure-build-image | |||
build-controller-binary: ensure-build-image lint |
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.
I feel like lint
should run on make test
(here)
wdyt?
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.
Makes sense, removed in build targets and put it in test one.
build/Makefile
Outdated
docker run --rm -e "CGO_ENABLED=0" $(common_mounts) $(build_tag) go build \ | ||
-o $(mount_path)/cmd/controller/bin/controller -a $(go_version_flags) -installsuffix cgo $(agones_package)/cmd/controller | ||
|
||
# Lint the go source code. | ||
lint: ensure-build-image | ||
docker run --rm $(common_mounts) -w $(mount_path) $(build_tag) bash -c \ |
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.
Minor nit - add $(DOCKER_RUN_ARGS) to this line.
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.
Done.
build/gen-lint-exclude.sh
Outdated
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
excluded=$(find . -name "*.go" | grep -v vendor | xargs grep autogenerated | cut -d ':' -f 1 | uniq | sed 's#\./##g') |
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.
This should probably go in build/build-image with the rest of the gen scripts.
Which will mean it will be automatically copied into the build Docker image so it will be easier to call.
May also want to also bump the ForceUpdate value to force the rebuild.
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.
Done and nice trick for the rebuild
build/gen-lint-exclude.sh
Outdated
@@ -0,0 +1,18 @@ | |||
#!/usr/bin/env bash | |||
|
|||
# Copyright 2017 Google Inc. All Rights Reserved. |
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.
Minor nit - 2018
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.
Done
@@ -56,7 +56,7 @@ var ( | |||
) | |||
|
|||
// main starts the operator for the gameserver CRD | |||
func main() { | |||
func main() { // nolint: gocyclo |
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.
Not for this PR - but we should make a ticket for this, because we should fix this.
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.
Created #177
@@ -29,7 +29,7 @@ import ( | |||
|
|||
// main starts a UDP server that received 1024 byte sized packets at at time | |||
// converts the bytes to a string, and logs the output | |||
func main() { | |||
func main() { // nolint: gocyclo |
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.
Same here, we should make a ticket to fix this one too.
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.
Created #178
@@ -56,6 +57,7 @@ func NewMocks() Mocks { | |||
return m | |||
} | |||
|
|||
// StartInformers starts new fake informers |
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.
👍 it's so good to have all of this picked up
sdks/go/sdk_test.go
Outdated
@@ -39,14 +39,14 @@ func TestSDK(t *testing.T) { | |||
assert.False(t, sm.shutdown) | |||
assert.False(t, sm.hm.healthy) | |||
|
|||
s.Ready() | |||
_ = s.Ready() |
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.
I feel like these should actually be
err := s.Ready() # change
assert.Nil(t, err) # add this line
assert.True(t, sm.ready)
assert.False(t, sm.shutdown)
For all the below. Better to fix the test, since we're here (no idea why I didn't do this in the first place)
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.
Sorry for this. Totally missed it too.
2c69845
to
a61fdc5
Compare
Rebased and squashed |
Build Succeeded 👏 Build Id: 067638c6-89dd-4568-a9ef-7e3f21d21cc3 The following development artifacts have been built, and will exist for the next 30 days:
|
This LGTM. @enocom do you have anything extra before we approve and merge this? |
LGTM |
Fixes #163