Skip to content

Commit

Permalink
update .golangci.yml (#49)
Browse files Browse the repository at this point in the history
* update .golangci.yml

Signed-off-by: adisos <[email protected]>

* lint fixes

Signed-off-by: adisos <[email protected]>

* update

Signed-off-by: adisos <[email protected]>

---------

Signed-off-by: adisos <[email protected]>
  • Loading branch information
adisos authored Jun 6, 2024
1 parent c4048f7 commit 9e2ccff
Show file tree
Hide file tree
Showing 15 changed files with 88 additions and 43 deletions.
28 changes: 14 additions & 14 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ linters-settings:
lines: 100
statements: 50
gci:
local-prefixes: github.com/np-guard
prefix: github.com/np-guard
goconst:
min-len: 2
min-occurrences: 2
Expand All @@ -23,27 +23,26 @@ linters-settings:
const:
COMPANY: IBM Inc.
template: |-
Copyright 2020- {{ COMPANY }} All Rights Reserved.
Copyright 2023- {{ COMPANY }} All Rights Reserved.
SPDX-License-Identifier: Apache-2.0
goimports:
local-prefixes: github.com/np-guard
gomnd:
settings:
mnd:
# don't include the "operation" and "assign"
checks: argument,case,condition,return
ignored-numbers: 0,1,2,3
ignored-functions: strings.SplitN
mnd:
# don't include the "operation" and "assign"
checks: argument,case,condition,return
ignored-numbers: 0,1,2,3
ignored-functions: strings.SplitN

govet:
check-shadowing: true
shadow: true
lll:
line-length: 140
misspell:
locale: US
nolintlint:
allow-leading-space: true # don't require machine-readable nolint directives (i.e. with no leading space)
allow-unused: true # report any unused nolint directives
allow-unused: false # report any unused nolint directives
require-explanation: false # don't require an explanation for nolint directives
require-specific: false # don't require nolint directives to be specific about which linter is being skipped
revive:
Expand Down Expand Up @@ -89,7 +88,7 @@ linters:
- gofmt
- goheader
- goimports
- gomnd
- mnd
- gomoddirectives
- goprintffuncname
- gosec
Expand Down Expand Up @@ -118,8 +117,6 @@ linters:
- tagliatelle
- tenv
- testableexamples
- thelper
- tparallel
- typecheck
- unconvert
- unparam
Expand All @@ -138,3 +135,6 @@ issues:

run:
timeout: 5m

output:
print-issued-lines: false
7 changes: 5 additions & 2 deletions pkg/connection/connectionset.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
// Copyright 2020- IBM Inc. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0
/*
Copyright 2023- IBM Inc. All Rights Reserved.
SPDX-License-Identifier: Apache-2.0
*/
package connection

import (
Expand Down
7 changes: 5 additions & 2 deletions pkg/connection/connectionset_test.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
// Copyright 2020- IBM Inc. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0
/*
Copyright 2023- IBM Inc. All Rights Reserved.
SPDX-License-Identifier: Apache-2.0
*/
package connection_test

import (
Expand Down
7 changes: 5 additions & 2 deletions pkg/connection/statefulness.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
// Copyright 2020- IBM Inc. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0
/*
Copyright 2023- IBM Inc. All Rights Reserved.
SPDX-License-Identifier: Apache-2.0
*/
package connection

import (
Expand Down
7 changes: 5 additions & 2 deletions pkg/connection/statefulness_test.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
// Copyright 2020- IBM Inc. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0
/*
Copyright 2023- IBM Inc. All Rights Reserved.
SPDX-License-Identifier: Apache-2.0
*/
package connection_test

import (
Expand Down
7 changes: 5 additions & 2 deletions pkg/hypercube/hypercubeset.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
// Copyright 2020- IBM Inc. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0
/*
Copyright 2023- IBM Inc. All Rights Reserved.
SPDX-License-Identifier: Apache-2.0
*/
package hypercube

import (
Expand Down
7 changes: 5 additions & 2 deletions pkg/hypercube/hypercubeset_test.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
// Copyright 2020- IBM Inc. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0
/*
Copyright 2023- IBM Inc. All Rights Reserved.
SPDX-License-Identifier: Apache-2.0
*/
package hypercube_test

import (
Expand Down
8 changes: 6 additions & 2 deletions pkg/interval/interval.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
// Copyright 2020- IBM Inc. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0
/*
Copyright 2023- IBM Inc. All Rights Reserved.
SPDX-License-Identifier: Apache-2.0
*/

package interval

import "fmt"
Expand Down
8 changes: 6 additions & 2 deletions pkg/interval/intervalset.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
// Copyright 2020- IBM Inc. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0
/*
Copyright 2023- IBM Inc. All Rights Reserved.
SPDX-License-Identifier: Apache-2.0
*/

package interval

import (
Expand Down
8 changes: 6 additions & 2 deletions pkg/interval/intervalset_test.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
// Copyright 2020- IBM Inc. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0
/*
Copyright 2023- IBM Inc. All Rights Reserved.
SPDX-License-Identifier: Apache-2.0
*/

package interval_test

import (
Expand Down
7 changes: 5 additions & 2 deletions pkg/ipblock/ipblock.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
// Copyright 2020- IBM Inc. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0
/*
Copyright 2023- IBM Inc. All Rights Reserved.
SPDX-License-Identifier: Apache-2.0
*/
package ipblock

import (
Expand Down
7 changes: 5 additions & 2 deletions pkg/ipblock/ipblock_test.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
// Copyright 2020- IBM Inc. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0
/*
Copyright 2023- IBM Inc. All Rights Reserved.
SPDX-License-Identifier: Apache-2.0
*/
package ipblock_test

import (
Expand Down
7 changes: 5 additions & 2 deletions pkg/netp/common.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
// Copyright 2020- IBM Inc. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0
/*
Copyright 2023- IBM Inc. All Rights Reserved.
SPDX-License-Identifier: Apache-2.0
*/
package netp

type Protocol interface {
Expand Down
9 changes: 6 additions & 3 deletions pkg/netp/icmp.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
// Copyright 2020- IBM Inc. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0
/*
Copyright 2023- IBM Inc. All Rights Reserved.
SPDX-License-Identifier: Apache-2.0
*/

package netp

import (
Expand Down Expand Up @@ -95,7 +99,6 @@ func inverseICMPType(t int) int {
return undefinedICMP
}

//nolint:revive // magic numbers are fine here
var maxCodes = map[int]int{
EchoReply: 0,
DestinationUnreachable: 5,
Expand Down
7 changes: 5 additions & 2 deletions pkg/netp/tcpudp.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
// Copyright 2020- IBM Inc. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0
/*
Copyright 2023- IBM Inc. All Rights Reserved.
SPDX-License-Identifier: Apache-2.0
*/
package netp

import "github.com/np-guard/models/pkg/interval"
Expand Down

0 comments on commit 9e2ccff

Please sign in to comment.