Skip to content

Commit

Permalink
chore: enable context-as-argument from revive linter (#2946)
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 authored Jan 27, 2025
1 parent 4f0bcf8 commit 6c6568b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
1 change: 0 additions & 1 deletion .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ linters-settings:
rules:
- name: blank-imports
- name: context-as-argument
disabled: true
arguments:
- allowTypesBefore: "*testing.T"
- name: context-keys-type
Expand Down
8 changes: 4 additions & 4 deletions modulegen/main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,7 @@ func TestGenerate(t *testing.T) {
assertModuleContent(t, module, filepath.Join(generatedTemplatesDir, moduleNameLower+".go"))
assertGoModContent(t, module, originalConfig.Extra.LatestVersion, filepath.Join(generatedTemplatesDir, "go.mod"))
assertMakefileContent(t, module, filepath.Join(generatedTemplatesDir, "Makefile"))
assertMkdocsNavItems(t, module, originalConfig, tmpCtx)
assertMkdocsNavItems(t, tmpCtx, module, originalConfig)
}

func TestGenerateModule(t *testing.T) {
Expand Down Expand Up @@ -352,7 +352,7 @@ func TestGenerateModule(t *testing.T) {
assertModuleContent(t, module, filepath.Join(generatedTemplatesDir, moduleNameLower+".go"))
assertGoModContent(t, module, originalConfig.Extra.LatestVersion, filepath.Join(generatedTemplatesDir, "go.mod"))
assertMakefileContent(t, module, filepath.Join(generatedTemplatesDir, "Makefile"))
assertMkdocsNavItems(t, module, originalConfig, tmpCtx)
assertMkdocsNavItems(t, tmpCtx, module, originalConfig)
}

// assert content module file in the docs
Expand Down Expand Up @@ -480,9 +480,9 @@ func assertMakefileContent(t *testing.T, module context.TestcontainersModule, ma
}

// assert content in the nav items from mkdocs.yml
func assertMkdocsNavItems(t *testing.T, module context.TestcontainersModule, originalConfig *mkdocs.Config, tmpCtx context.Context) {
func assertMkdocsNavItems(t *testing.T, ctx context.Context, module context.TestcontainersModule, originalConfig *mkdocs.Config) {
t.Helper()
config, err := mkdocs.ReadConfig(tmpCtx.MkdocsConfigFile())
config, err := mkdocs.ReadConfig(ctx.MkdocsConfigFile())
require.NoError(t, err)

parentDir := module.ParentDir()
Expand Down

0 comments on commit 6c6568b

Please sign in to comment.