Skip to content

Commit

Permalink
Fix codefactor warnings and add it to readme
Browse files Browse the repository at this point in the history
  • Loading branch information
DerAndereAndi committed Jan 22, 2024
1 parent 048f626 commit ab10d10
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 10 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
[![GoDoc](https://img.shields.io/badge/godoc-reference-5272B4)](https://godoc.org/github.com/enbility/spine-go)
[![Coverage Status](https://coveralls.io/repos/github/enbility/spine-go/badge.svg?branch=dev)](https://coveralls.io/github/enbility/eebus-go?branch=dev)
[![Go report](https://goreportcard.com/badge/github.com/enbility/spine-go)](https://goreportcard.com/report/github.com/enbility/spine-go)
[![CodeFactor](https://www.codefactor.io/repository/github/enbility/spine-go/badge)](https://www.codefactor.io/repository/github/enbility/spine-go)

## Introduction

Expand Down
20 changes: 10 additions & 10 deletions model/electricalconnection_additions_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -431,7 +431,7 @@ func TestElectricalConnectionPermittedValueSetListDataType_Update_Delete_Modify(
return
}

delete := &FilterType{
deleteFilter := &FilterType{
CmdControl: &CmdControlType{
Delete: &ElementTagType{},
},
Expand All @@ -442,7 +442,7 @@ func TestElectricalConnectionPermittedValueSetListDataType_Update_Delete_Modify(
}

// Act
sut.UpdateList(&newData, NewFilterTypePartial(), delete)
sut.UpdateList(&newData, NewFilterTypePartial(), deleteFilter)

data := sut.ElectricalConnectionPermittedValueSetData
// check the deleted item is gone
Expand Down Expand Up @@ -527,7 +527,7 @@ func TestElectricalConnectionPermittedValueSetListDataType_Update_Delete(t *test
return
}

delete := &FilterType{
deleteFilter := &FilterType{
CmdControl: &CmdControlType{
Delete: &ElementTagType{},
},
Expand All @@ -538,7 +538,7 @@ func TestElectricalConnectionPermittedValueSetListDataType_Update_Delete(t *test
}

// Act
sut.UpdateList(nil, nil, delete)
sut.UpdateList(nil, nil, deleteFilter)

data := sut.ElectricalConnectionPermittedValueSetData
// check the deleted item is added again
Expand Down Expand Up @@ -623,7 +623,7 @@ func TestElectricalConnectionPermittedValueSetListDataType_Update_Delete_Element
return
}

delete := &FilterType{
deleteFilter := &FilterType{
CmdControl: &CmdControlType{
Delete: &ElementTagType{},
},
Expand All @@ -637,7 +637,7 @@ func TestElectricalConnectionPermittedValueSetListDataType_Update_Delete_Element
}

// Act
sut.UpdateList(nil, nil, delete)
sut.UpdateList(nil, nil, deleteFilter)

data := sut.ElectricalConnectionPermittedValueSetData
// check no items are deleted
Expand Down Expand Up @@ -729,7 +729,7 @@ func TestElectricalConnectionPermittedValueSetListDataType_Update_Delete_OnlyEle
return
}

delete := &FilterType{
deleteFilter := &FilterType{
CmdControl: &CmdControlType{
Delete: &ElementTagType{},
},
Expand All @@ -739,7 +739,7 @@ func TestElectricalConnectionPermittedValueSetListDataType_Update_Delete_OnlyEle
}

// Act
sut.UpdateList(nil, nil, delete)
sut.UpdateList(nil, nil, deleteFilter)

data := sut.ElectricalConnectionPermittedValueSetData
// check no items are deleted
Expand Down Expand Up @@ -902,7 +902,7 @@ func TestElectricalConnectionPermittedValueSetListDataType_Update_Delete_Add(t *
return
}

delete := &FilterType{
deleteFilter := &FilterType{
CmdControl: &CmdControlType{
Delete: &ElementTagType{},
},
Expand All @@ -913,7 +913,7 @@ func TestElectricalConnectionPermittedValueSetListDataType_Update_Delete_Add(t *
}

// Act
sut.UpdateList(&newData, NewFilterTypePartial(), delete)
sut.UpdateList(&newData, NewFilterTypePartial(), deleteFilter)

data := sut.ElectricalConnectionPermittedValueSetData
// check the deleted item is added again
Expand Down
2 changes: 2 additions & 0 deletions spine/device_local.go
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,8 @@ func (r *DeviceLocalImpl) HandleEvent(payload api.EventPayload) {
return
}

// the codefactor warning is invalid, as .(type) check can not be replaced with if then
//revive:disable-next-line
switch payload.Data.(type) {
case *model.NodeManagementDetailedDiscoveryDataType:
_, _ = r.nodeManagement.Subscribe(payload.Feature.Address())
Expand Down

0 comments on commit ab10d10

Please sign in to comment.