Skip to content

Commit

Permalink
chore: Adds lint checks to CI
Browse files Browse the repository at this point in the history
  • Loading branch information
gruyaume committed Jan 3, 2024
1 parent b3ca53c commit 2e35e76
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 19 deletions.
15 changes: 15 additions & 0 deletions .github/workflows/master.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,18 @@ jobs:

- name: Unit tests
run: go test ./...

lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- uses: actions/setup-go@v5
with:
go-version-file: 'go.mod'

- name: golangci-lint
uses: golangci/[email protected]
with:
version: latest
args: -v --config ./.golangci.yml
31 changes: 14 additions & 17 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -220,36 +220,33 @@ linters-settings:

linters:
enable:
- gofmt
- govet
- errcheck
- staticcheck
- unused
- gosimple
- structcheck
- varcheck
- ineffassign
- deadcode
# - gofmt
# - govet
# - errcheck
# - staticcheck
# - unused
# - gosimple
# - ineffassign
- typecheck
# Additional
- lll
# - lll
- godox
#- gomnd
#- goconst
# - gocognit
# - maligned
# - nestif
# - gomodguard
- nakedret
- gci
# - nakedret
# - gci
- misspell
- gofumpt
- whitespace
- unconvert
# - gofumpt
# - whitespace
# - unconvert
- predeclared
- noctx
- dogsled
- bodyclose
# - bodyclose
- asciicheck
#- stylecheck
# - unparam
Expand Down
3 changes: 1 addition & 2 deletions service/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -686,10 +686,9 @@ func (pcf *PCF) UpdatePcfSubsriberPolicyData(slice *protos.NetworkSlice) {

for _, imsi := range slice.AddUpdatedImsis {
if ImsiExistInDeviceGroup(devgroup, imsi) {
policyData, _ := self.PcfSubscriberPolicyData[imsi]
// TODO policy exists, so compare and get difference with existing policy then notify the subscriber
self.PcfSubscriberPolicyData[imsi] = &context.PcfSubscriberPolicyData{}
policyData = self.PcfSubscriberPolicyData[imsi]
policyData := self.PcfSubscriberPolicyData[imsi]
policyData.CtxLog = logger.CtxLog.WithField(logger.FieldSupi, "imsi-"+imsi)
policyData.PccPolicy = make(map[string]*context.PccPolicy)
policyData.PccPolicy[sliceid] = &context.PccPolicy{make(map[string]*models.PccRule),
Expand Down

0 comments on commit 2e35e76

Please sign in to comment.