Skip to content
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

MYST-114 Fix linter rules in "communication" package #97

Merged
merged 13 commits into from Jan 13, 2018

Conversation

Projects
None yet
2 participants
@Waldz
Copy link
Member

commented Jan 11, 2018

No description provided.

@Waldz Waldz force-pushed the feature/MYST-114-com-linter branch from d030765 to 6f6c1a5 Jan 11, 2018

@@ -4,6 +4,6 @@
function get_linker_ldflags {
echo "
-X 'github.com/mysterium/node/server.mysteriumApiUrl=${MYSTERIUM_API_URL}'
-X 'github.com/mysterium/node/communication/nats_discovery.natsServerIp=${NATS_SERVER_IP}'
-X 'github.com/mysterium/node/communication/natsdiscovery.natsServerIp=${NATS_SERVER_IP}'

This comment has been minimized.

Copy link
@donce

donce Jan 12, 2018

Contributor

From effective Go (https://golang.org/doc/effective_go.html#names):

By convention, packages are given lower case, single-word names; there should be no need for underscores or mixedCaps.

Can we name it just communucation/discovery? natsdiscovery is very unfriendly and is against effective go.

This comment has been minimized.

Copy link
@Waldz

Waldz Jan 12, 2018

Author Member

Thanks for good point. Fixed

bin/lint Outdated

ARGUMENTS=$@
if [ -z "$ARGUMENTS" ]; then
ARGUMENTS=`go list ./... | grep -v /vendor/`

This comment has been minimized.

Copy link
@donce

donce Jan 12, 2018

Contributor

grepping here is not necessary - go list ./... already excludes vendor packages. And since we're planning to do compilation using docker - we can choose not to use old Go version.

This comment has been minimized.

Copy link
@Waldz

Waldz Jan 12, 2018

Author Member

Fixed

This comment has been minimized.

Copy link
@Waldz

Waldz Jan 12, 2018

Author Member

Though we never know which environment contributors will develop on

bin/lint Outdated
ARGUMENTS=`go list ./... | grep -v /vendor/`
fi

go run vendor/github.com/golang/lint/golint/*.go -min_confidence=1 -set_exit_status ${ARGUMENTS}

This comment has been minimized.

Copy link
@donce

donce Jan 12, 2018

Contributor

What errors are we hiding by increasing min_confidence?

This comment has been minimized.

Copy link
@Waldz

Waldz Jan 12, 2018

Author Member

e.g. exported func NewCodecJSON returns unexported type *communication.codecJSON, which can be annoying to use
But currently we already have too many errors.

@@ -1,15 +1,18 @@
package communication

type RequestType string
// RequestEndpoint is ppecial type that describes unique message endpoint

This comment has been minimized.

Copy link
@donce

donce Jan 12, 2018

Contributor

ppecial

This comment has been minimized.

Copy link
@Waldz

Waldz Jan 12, 2018

Author Member

Fixed

@Waldz Waldz force-pushed the feature/MYST-114-com-linter branch from 6f6c1a5 to 3702529 Jan 12, 2018

@donce

donce approved these changes Jan 13, 2018

Copy link
Contributor

left a comment

LGTM

@Waldz Waldz merged commit 29c4cf1 into master Jan 13, 2018

@Waldz Waldz deleted the feature/MYST-114-com-linter branch Jan 13, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.