Skip to content

Commit

Permalink
chore: enable revive linter
Browse files Browse the repository at this point in the history
Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>
  • Loading branch information
mmorel-35 committed Jan 15, 2025
1 parent 8b5211f commit b6ff205
Show file tree
Hide file tree
Showing 5 changed files with 52 additions and 9 deletions.
47 changes: 45 additions & 2 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,12 @@ linters:
- nolintlint
- nakedret
- perfsprint
- revive
- testifylint
- thelper
- usestdlibvars

linters-settings:
nakedret:
max-func-lines: 0
errorlint:
# Check whether fmt.Errorf uses the %w verb for formatting errors.
# See the https://github.com/polyfloyd/go-errorlint for caveats.
Expand All @@ -31,6 +30,50 @@ linters-settings:
- standard
- default
- prefix(github.com/testcontainers)
nakedret:
max-func-lines: 0
revive:
min-confidence: 0.8
rules:
- name: blank-imports
- name: context-as-argument
disabled: true
arguments:
- allowTypesBefore: "*testing.T"
- name: context-keys-type
- name: dot-imports
- name: early-return
disabled: true
arguments:
- "preserveScope"
- name: empty-block
disabled: true
- name: error-naming
disabled: true
- name: error-return
- name: error-strings
- name: errorf
- name: increment-decrement
- name: indent-error-flow
disabled: true
- name: range
- name: receiver-naming
- name: redefines-builtin-id
disabled: true
- name: superfluous-else
arguments:
- "preserveScope"
- name: time-naming
- name: unexported-return
disabled: true
- name: unreachable-code
- name: unused-parameter
disabled: true
- name: use-any
disabled: true
- name: var-declaration
- name: var-naming
disabled: true
testifylint:
disable:
- float-compare
Expand Down
2 changes: 1 addition & 1 deletion container.go
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ func (c *ContainerRequest) Validate() error {
// GetContext retrieve the build context for the request
// Must be closed when no longer needed.
func (c *ContainerRequest) GetContext() (io.Reader, error) {
var includes []string = []string{"."}
includes := []string{"."}

if c.ContextArchive != nil {
return c.ContextArchive, nil
Expand Down
2 changes: 1 addition & 1 deletion internal/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ const ReaperDefaultImage = "testcontainers/ryuk:0.11.0"

var (
tcConfig Config
tcConfigOnce *sync.Once = new(sync.Once)
tcConfigOnce = new(sync.Once)
)

// testcontainersConfig {
Expand Down
8 changes: 4 additions & 4 deletions internal/core/images_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ const (
)

func TestExtractImagesFromDockerfile(t *testing.T) {
var baseImage string = "scratch"
var registryHost string = "localhost"
var registryPort string = "5000"
var nginxImage string = "nginx:latest"
baseImage := "scratch"
registryHost := "localhost"
registryPort := "5000"
nginxImage := "nginx:latest"

tests := []struct {
name string
Expand Down
2 changes: 1 addition & 1 deletion modules/dynamodb/dynamodb_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ const (
baseImage string = "amazon/dynamodb-local:"
)

var image2_2_1 string = baseImage + "2.2.1"
var image2_2_1 = baseImage + "2.2.1"

func TestRun(t *testing.T) {
ctx := context.Background()
Expand Down

0 comments on commit b6ff205

Please sign in to comment.