Skip to content
This repository has been archived by the owner on Aug 2, 2023. It is now read-only.

Commit

Permalink
codeclimate: be quiet
Browse files Browse the repository at this point in the history
Signed-off-by: Yoan Blanc <yoan.blanc@exoscale.ch>
  • Loading branch information
Yoan Blanc committed Apr 9, 2018
1 parent e2d6edb commit fd16d42
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 12 deletions.
25 changes: 22 additions & 3 deletions .codeclimate.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,31 @@
version: "2"

checks:
argument-count:
enabled: false
complex-logic:
enabled: false
file-lines:
enabled: false
method-complexity:
enabled: false
method-count:
enabled: false
method-lines:
enabled: false
nested-control-flow:
enabled: false
return-statements:
enabled: false
similar-code:
enabled: false
identical-code:
enabled: false

plugins:
gofmt:
enabled: true
golint:
enabled: true
govet:
enabled: true

exclude_paths:
- vendor/
4 changes: 2 additions & 2 deletions Gopkg.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions api.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,11 @@ func VMHasSecurityGroup(vm *egoscale.VirtualMachine, sgname string) bool {
}

// getSecurityGroupPeers returns the other machines within the same security group
func getSecurityGroupPeers(client *egoscale.Client, zoneId string, securityGroupName string) ([]string, error) {
func getSecurityGroupPeers(client *egoscale.Client, zoneID string, securityGroupName string) ([]string, error) {

peers := make([]string, 0)
vms, err := client.List(&egoscale.VirtualMachine{
ZoneID: zoneId,
ZoneID: zoneID,
})

if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion engine.go
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,7 @@ func (engine *Engine) ReleaseNic(nicID string) error {
return nil
}

// RefreshPeers refreshes the list of the peers based on the security group
// UpdatePeers refreshes the list of the peers based on the security group
func (engine *Engine) UpdatePeers() error {
if engine.SecurityGroupName == "" {
// skip
Expand Down
8 changes: 4 additions & 4 deletions payload.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ func NewPayload(buf []byte) (*Payload, error) {

version := hex.EncodeToString(protobuf)
if ProtoVersion != version {
Logger.Warning(fmt.Sprintf("bad protocol version, got %d", version))
Logger.Warning(fmt.Sprintf("bad protocol version, got %v", version))
return nil, errors.New("bad protocol version")
}

Expand All @@ -36,13 +36,13 @@ func NewPayload(buf []byte) (*Payload, error) {
return nil, errors.New("bad payload (priority should repeat)")
}

nicId, err := UUIDToStr(uuidbuf)
nicID, err := UUIDToStr(uuidbuf)
if err != nil {
return nil, err
}

payload := &Payload{
NicID: nicId,
NicID: nicID,
Priority: buf[2],
IP: net.IPv4(buf[4], buf[5], buf[6], buf[7]),
}
Expand All @@ -56,7 +56,7 @@ func UUIDToStr(buf []byte) (string, error) {
return "", fmt.Errorf("UUID length (%d) mismatch, need 16", len(buf))
}

uuid := fmt.Sprintf("%x-%x-%x-%x", buf[0:4], buf[4:6], buf[6:8], buf[8:10], buf[10:16])
uuid := fmt.Sprintf("%x-%x-%x-%x-%x", buf[0:4], buf[4:6], buf[6:8], buf[8:10], buf[10:16])

return uuid, nil
}
Expand Down

0 comments on commit fd16d42

Please sign in to comment.