Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding test Lint Presets #3340

Merged
merged 9 commits into from
Aug 14, 2024
Merged

Adding test Lint Presets #3340

merged 9 commits into from
Aug 14, 2024

Conversation

yhakbar
Copy link
Collaborator

@yhakbar yhakbar commented Aug 13, 2024

Description

Adds the test lint preset.

TODOs

Read the Gruntwork contribution guidelines.

  • Update the docs.
  • Run the relevant tests successfully, including pre-commit checks.
  • Ensure any 3rd party code adheres with our license policy or delete this line if its not applicable.
  • Include release notes. If this PR is backward incompatible, include a migration guide.

Release Notes (draft)

Updated package aws_helper_test
Updated package awsproviderpatch
Updated package awsproviderpatch_test
Updated package cache_test
Updated package cli
Updated package cli_test
Updated package cliconfig_test
Updated package codegen_test
Updated package config
Updated package config_test
Updated package configstack
Updated package configstack_test
Updated package dynamodb
Updated package dynamodb_test
Updated package engine
Updated package engine_test
Updated package getproviders
Updated package getproviders_test
Updated package graphdependencies_test
Updated package hclfmt_test
Updated package integration_test
Updated package models_test
Updated package module
Updated package module_test
Updated package remote
Updated package remote_test
Updated package runall_test
Updated package scaffold
Updated package scaffold_test
Updated package shell
Updated package shell_test
Updated package telemetry
Updated package telemetry_test
Updated package terraform
Updated package terraform_test
Updated package tflint
Updated package tflint_test
Updated package util
Updated package util_test
Updated package validateinputs
Updated package validateinputs_test

@yhakbar yhakbar force-pushed the chore/adding-golangci-test-lints branch 4 times, most recently from e1a5d48 to c251026 Compare August 13, 2024 21:20
@yhakbar yhakbar force-pushed the chore/adding-golangci-test-lints branch from c251026 to e268b71 Compare August 13, 2024 22:05
@yhakbar yhakbar force-pushed the chore/adding-golangci-test-lints branch from e268b71 to ac8841d Compare August 13, 2024 22:09
@yhakbar yhakbar changed the title [WIP] - Adding test Lint Presets Adding test Lint Presets Aug 13, 2024
@yhakbar yhakbar marked this pull request as ready for review August 13, 2024 22:18
@yhakbar
Copy link
Collaborator Author

yhakbar commented Aug 13, 2024

Findings before addressing them:

$ git checkout 927760bebc3f7400c19f601cb0244e718c14f040
$ golangci-lint run
cli/app_test.go:497:1: Function TestAutocomplete missing the call to method parallel (paralleltest)
func TestAutocomplete(t *testing.T) {
^
cli/app_test.go:1:9: package should be `cli_test` instead of `cli` (testpackage)
package cli
        ^
cli/provider_cache_test.go:1:9: package should be `cli_test` instead of `cli` (testpackage)
package cli
        ^
cli/commands/catalog/module/doc_test.go:1:9: package should be `module_test` instead of `module` (testpackage)
package module
        ^
cli/commands/catalog/module/repo_test.go:1:9: package should be `module_test` instead of `module` (testpackage)
package module
        ^
test/integration_include_test.go:43:2: Range statement for test TestTerragruntWorksWithIncludeLocals missing the call to method parallel in test Run (paralleltest)
	for _, testCase := range testCases {
	^
test/integration_serial_test.go:34:1: Function TestTerragruntProviderCacheWithFilesystemMirror missing the call to method parallel (paralleltest)
func TestTerragruntProviderCacheWithFilesystemMirror(t *testing.T) {
^
test/integration_serial_test.go:101:1: Function TestTerragruntProviderCacheWithNetworkMirror missing the call to method parallel (paralleltest)
func TestTerragruntProviderCacheWithNetworkMirror(t *testing.T) {
^
test/integration_serial_test.go:198:1: Function TestTerragruntInputsFromDependency missing the call to method parallel (paralleltest)
func TestTerragruntInputsFromDependency(t *testing.T) {
^
test/integration_serial_test.go:341:1: Function TestTerragruntCorrectlyMirrorsTerraformGCPAuth missing the call to method parallel (paralleltest)
func TestTerragruntCorrectlyMirrorsTerraformGCPAuth(t *testing.T) {
^
test/integration_serial_test.go:367:1: Function TestExtraArguments missing the call to method parallel (paralleltest)
func TestExtraArguments(t *testing.T) {
^
test/integration_serial_test.go:382:1: Function TestExtraArgumentsWithEnvVarBlock missing the call to method parallel (paralleltest)
func TestExtraArgumentsWithEnvVarBlock(t *testing.T) {
^
test/integration_serial_test.go:419:1: Function TestPriorityOrderOfArgument missing the call to method parallel (paralleltest)
func TestPriorityOrderOfArgument(t *testing.T) {
^
test/integration_serial_test.go:547:1: Function TestTerragruntParallelism missing the call to method parallel (paralleltest)
func TestTerragruntParallelism(t *testing.T) {
^
test/integration_serial_test.go:558:2: Range statement for test TestTerragruntParallelism missing the call to method parallel in test Run (paralleltest)
	for _, tc := range testCases {
	^
test/integration_serial_test.go:635:1: Function TestTerragruntOutputJson missing the call to method parallel (paralleltest)
func TestTerragruntOutputJson(t *testing.T) {
^
test/integration_serial_test.go:673:1: Function TestTerragruntTerraformOutputJson missing the call to method parallel (paralleltest)
func TestTerragruntTerraformOutputJson(t *testing.T) {
^
test/integration_serial_test.go:702:1: Function TestTerragruntOutputFromDependencyLogsJson missing the call to method parallel (paralleltest)
func TestTerragruntOutputFromDependencyLogsJson(t *testing.T) {
^
test/integration_serial_test.go:712:2: Range statement for test TestTerragruntOutputFromDependencyLogsJson missing the call to method parallel in test Run (paralleltest)
	for _, testCase := range testCases {
	^
test/integration_serial_test.go:734:1: Function TestTerragruntJsonPlanJsonOutput missing the call to method parallel (paralleltest)
func TestTerragruntJsonPlanJsonOutput(t *testing.T) {
^
test/integration_serial_test.go:744:2: Range statement for test TestTerragruntJsonPlanJsonOutput missing the call to method parallel in test Run (paralleltest)
	for _, testCase := range testCases {
	^
test/integration_serial_test.go:812:1: Function TestTerragruntProviderCache missing the call to method parallel (paralleltest)
func TestTerragruntProviderCache(t *testing.T) {
^
test/integration_serial_test.go:901:1: Function TestReadTerragruntAuthProviderCmdRemoteState missing the call to method parallel (paralleltest)
func TestReadTerragruntAuthProviderCmdRemoteState(t *testing.T) {
^
test/integration_serial_test.go:933:1: Function TestReadTerragruntAuthProviderCmdCredsForDependency missing the call to method parallel (paralleltest)
func TestReadTerragruntAuthProviderCmdCredsForDependency(t *testing.T) {
^
test/integration_test.go:239:2: Range statement for test TestTerragruntExcludesFile missing the call to method parallel in test Run (paralleltest)
	for i, testCase := range testCases {
	^
test/integration_test.go:363:1: Function TestHclvalidateInvalidConfigPath missing the call to method parallel (paralleltest)
func TestHclvalidateInvalidConfigPath(t *testing.T) {
^
test/integration_test.go:1110:1: Function TestTerragruntReportsTerraformErrorsWithPlanAll missing the call to method parallel (paralleltest)
func TestTerragruntReportsTerraformErrorsWithPlanAll(t *testing.T) {
^
test/integration_test.go:1349:1: Function TestTerragruntStackCommands missing the call to method parallel (paralleltest)
func TestTerragruntStackCommands(t *testing.T) {
^
test/integration_test.go:2275:1: Function TestDependencyOutputOptimization missing the call to method parallel (paralleltest)
func TestDependencyOutputOptimization(t *testing.T) {
^
test/integration_test.go:2282:1: Function TestDependencyOutputOptimizationSkipInit missing the call to method parallel (paralleltest)
func TestDependencyOutputOptimizationSkipInit(t *testing.T) {
^
test/integration_test.go:2289:1: Function TestDependencyOutputOptimizationNoGenerate missing the call to method parallel (paralleltest)
func TestDependencyOutputOptimizationNoGenerate(t *testing.T) {
^
test/integration_test.go:4221:1: Function TestTerragruntVersionConstraints missing the call to method parallel (paralleltest)
func TestTerragruntVersionConstraints(t *testing.T) {
^
test/integration_test.go:4260:2: Range statement for test TestTerragruntVersionConstraints missing the call to method parallel in test Run (paralleltest)
	for _, testCase := range testCases {
	^
test/integration_test.go:4368:1: Function TestTerragruntVersionConstraintsPartialParse missing the call to method parallel (paralleltest)
func TestTerragruntVersionConstraintsPartialParse(t *testing.T) {
^
test/integration_test.go:4386:1: Function TestLogFailedLocalsEvaluation missing the call to method parallel (paralleltest)
func TestLogFailedLocalsEvaluation(t *testing.T) {
^
test/integration_test.go:4402:1: Function TestLogFailingDependencies missing the call to method parallel (paralleltest)
func TestLogFailingDependencies(t *testing.T) {
^
test/integration_test.go:5207:1: Function TestShowWarningWithDependentModulesBeforeDestroy missing the call to method parallel (paralleltest)
func TestShowWarningWithDependentModulesBeforeDestroy(t *testing.T) {
^
test/integration_test.go:5239:1: Function TestTerragruntOutputFromRemoteState missing the call to method parallel (paralleltest)
func TestTerragruntOutputFromRemoteState(t *testing.T) {
^
test/integration_test.go:5566:2: Range statement for test TestOutputModuleGroups missing the call to method parallel in test Run (paralleltest)
	for name, tt := range tests {
	^
test/integration_test.go:6968:2: Range statement for test TestTerragruntDestroyGraph missing the call to method parallel in test Run (paralleltest)
	for _, testCase := range testCases {
	^
test/integration_test.go:7015:2: Range statement for test TestTerragruntApplyGraph missing the call to method parallel in test Run (paralleltest)
	for _, testCase := range testCases {
	^
test/integration_catalog_test.go:1:9: package should be `test_test` instead of `test` (testpackage)
package test
        ^
test/integration_common_test.go:2:9: package should be `test_test` instead of `test` (testpackage)
package test
        ^
test/integration_debug_test.go:1:9: package should be `test_test` instead of `test` (testpackage)
package test
        ^
test/integration_download_test.go:1:9: package should be `test_test` instead of `test` (testpackage)
package test
        ^
test/integration_include_test.go:1:9: package should be `test_test` instead of `test` (testpackage)
package test
        ^
test/integration_local_dev_test.go:1:9: package should be `test_test` instead of `test` (testpackage)
package test
        ^
test/integration_registry_test.go:1:9: package should be `test_test` instead of `test` (testpackage)
package test
        ^
test/integration_s3_encryption_test.go:1:9: package should be `test_test` instead of `test` (testpackage)
package test
        ^
test/integration_scaffold_test.go:1:9: package should be `test_test` instead of `test` (testpackage)
package test
        ^
test/integration_serial_test.go:1:9: package should be `test_test` instead of `test` (testpackage)
package test
        ^
test/integration_test.go:1:9: package should be `test_test` instead of `test` (testpackage)
package test
        ^
test/integration_unix_test.go:4:9: package should be `test_test` instead of `test` (testpackage)
package test
        ^
test/integration_test.go:219:6: TestTerragruntExcludesFile's subtests should call t.Parallel (tparallel)
func TestTerragruntExcludesFile(t *testing.T) {
     ^
test/integration_include_test.go:30:6: TestTerragruntWorksWithIncludeLocals's subtests should call t.Parallel (tparallel)
func TestTerragruntWorksWithIncludeLocals(t *testing.T) {
     ^
test/integration_test.go:6938:6: TestTerragruntDestroyGraph's subtests should call t.Parallel (tparallel)
func TestTerragruntDestroyGraph(t *testing.T) {
     ^
test/integration_test.go:6990:6: TestTerragruntApplyGraph's subtests should call t.Parallel (tparallel)
func TestTerragruntApplyGraph(t *testing.T) {
     ^
test/integration_test.go:5507:6: TestOutputModuleGroups's subtests should call t.Parallel (tparallel)
func TestOutputModuleGroups(t *testing.T) {
     ^
cli/commands/aws-provider-patch/action_test.go:1:9: package should be `awsproviderpatch_test` instead of `awsproviderpatch` (testpackage)
package awsproviderpatch
        ^
cli/commands/validate-inputs/action_test.go:1:9: package should be `validateinputs_test` instead of `validateinputs` (testpackage)
package validateinputs
        ^
cli/commands/run-all/action_test.go:1:9: package should be `runall_test` instead of `runall` (testpackage)
package runall
        ^
cli/commands/scaffold/action_test.go:1:9: package should be `scaffold_test` instead of `scaffold` (testpackage)
package scaffold
        ^
engine/engine_test.go:1:9: package should be `engine_test` instead of `engine` (testpackage)
package engine
        ^
terraform/cache/models/provider_test.go:1:9: package should be `models_test` instead of `models` (testpackage)
package models
        ^
dynamodb/counting_semaphore_test.go:2:9: package should be `dynamodb_test` instead of `dynamodb` (testpackage)
package dynamodb
        ^
dynamodb/dynamo_lock_table_test.go:1:9: package should be `dynamodb_test` instead of `dynamodb` (testpackage)
package dynamodb
        ^
codegen/generate_test.go:14:1: Function TestRemoteStateConfigToTerraformCode missing the call to method parallel (paralleltest)
func TestRemoteStateConfigToTerraformCode(t *testing.T) {
^
codegen/generate_test.go:53:2: Range statement for test TestRemoteStateConfigToTerraformCode missing the call to method parallel in test Run (paralleltest)
	for _, testCase := range testCases {
	^
codegen/generate_test.go:71:1: Function TestGenerateDisabling missing the call to method parallel (paralleltest)
func TestGenerateDisabling(t *testing.T) {
^
codegen/generate_test.go:97:2: Range statement for test TestGenerateDisabling missing the call to method parallel in test Run (paralleltest)
	for _, testCase := range testCases {
	^
codegen/generate_test.go:1:9: package should be `codegen_test` instead of `codegen` (testpackage)
package codegen
        ^
configstack/module_test.go:16:1: Function TestGraph missing the call to method parallel (paralleltest)
func TestGraph(t *testing.T) {
^
configstack/module_test.go:53:1: Function TestGraphTrimPrefix missing the call to method parallel (paralleltest)
func TestGraphTrimPrefix(t *testing.T) {
^
configstack/module_test.go:90:1: Function TestGraphFlagExcluded missing the call to method parallel (paralleltest)
func TestGraphFlagExcluded(t *testing.T) {
^
configstack/stack_test.go:1115:1: Function TestBasicDependency missing the call to method parallel (paralleltest)
func TestBasicDependency(t *testing.T) {
^
configstack/stack_test.go:1134:1: Function TestNestedDependencies missing the call to method parallel (paralleltest)
func TestNestedDependencies(t *testing.T) {
^
configstack/stack_test.go:1159:1: Function TestCircularDependencies missing the call to method parallel (paralleltest)
func TestCircularDependencies(t *testing.T) {
^
configstack/log_test.go:1:9: package should be `configstack_test` instead of `configstack` (testpackage)
package configstack
        ^
configstack/module_test.go:1:9: package should be `configstack_test` instead of `configstack` (testpackage)
package configstack
        ^
configstack/running_module_test.go:1:9: package should be `configstack_test` instead of `configstack` (testpackage)
package configstack
        ^
configstack/stack_test.go:1:9: package should be `configstack_test` instead of `configstack` (testpackage)
package configstack
        ^
cli/commands/hclfmt/action_test.go:1:9: package should be `hclfmt_test` instead of `hclfmt` (testpackage)
package hclfmt
        ^
cli/commands/hclfmt/action_test.go:204:6: TestHCLFmtFile's subtests should call t.Parallel (tparallel)
func TestHCLFmtFile(t *testing.T) {
     ^
cli/commands/hclfmt/action_test.go:16:6: TestHCLFmt's subtests should call t.Parallel (tparallel)
func TestHCLFmt(t *testing.T) {
     ^
cli/commands/hclfmt/action_test.go:76:6: TestHCLFmtErrors's subtests should call t.Parallel (tparallel)
func TestHCLFmtErrors(t *testing.T) {
     ^
cli/commands/hclfmt/action_test.go:112:6: TestHCLFmtCheck's subtests should call t.Parallel (tparallel)
func TestHCLFmtCheck(t *testing.T) {
     ^
cli/commands/hclfmt/action_test.go:158:6: TestHCLFmtCheckErrors's subtests should call t.Parallel (tparallel)
func TestHCLFmtCheckErrors(t *testing.T) {
     ^
terraform/cliconfig/config_test.go:1:9: package should be `cliconfig_test` instead of `cliconfig` (testpackage)
package cliconfig
        ^
tflint/tflint_test.go:1:9: package should be `tflint_test` instead of `tflint` (testpackage)
package tflint
        ^
internal/cache/cache_test.go:1:9: package should be `cache_test` instead of `cache` (testpackage)
package cache
        ^
util/file_test.go:164:2: Range statement for test TestJoinTerraformModulePath missing the call to method parallel in test Run (paralleltest)
	for _, testCase := range testCases {
	^
util/file_test.go:286:1: Function TestIncludeInCopy missing the call to method parallel (paralleltest)
func TestIncludeInCopy(t *testing.T) {
^
util/collections_test.go:1:9: package should be `util_test` instead of `util` (testpackage)
package util
        ^
util/datetime_test.go:1:9: package should be `util_test` instead of `util` (testpackage)
package util
        ^
util/file_test.go:1:9: package should be `util_test` instead of `util` (testpackage)
package util
        ^
util/jsons_test.go:1:9: package should be `util_test` instead of `util` (testpackage)
package util
        ^
util/locks_test.go:1:9: package should be `util_test` instead of `util` (testpackage)
package util
        ^
util/min_test.go:1:9: package should be `util_test` instead of `util` (testpackage)
package util
        ^
util/prefix-writer_test.go:1:9: package should be `util_test` instead of `util` (testpackage)
package util
        ^
util/random_test.go:1:9: package should be `util_test` instead of `util` (testpackage)
package util
        ^
util/reflect_test.go:1:9: package should be `util_test` instead of `util` (testpackage)
package util
        ^
util/shell_test.go:1:9: package should be `util_test` instead of `util` (testpackage)
package util
        ^
util/file_test.go:140:6: TestJoinTerraformModulePath's subtests should call t.Parallel (tparallel)
func TestJoinTerraformModulePath(t *testing.T) {
     ^
cli/commands/graph-dependencies/action_test.go:1:9: package should be `graphdependencies_test` instead of `graphdependencies` (testpackage)
package graphdependencies
        ^
pkg/cli/args_test.go:1:9: package should be `cli_test` instead of `cli` (testpackage)
package cli
        ^
pkg/cli/bool_flag_test.go:1:9: package should be `cli_test` instead of `cli` (testpackage)
package cli
        ^
pkg/cli/command_test.go:1:9: package should be `cli_test` instead of `cli` (testpackage)
package cli
        ^
pkg/cli/flag_test.go:1:9: package should be `cli_test` instead of `cli` (testpackage)
package cli
        ^
pkg/cli/flags_test.go:1:9: package should be `cli_test` instead of `cli` (testpackage)
package cli
        ^
pkg/cli/generic_flag_test.go:1:9: package should be `cli_test` instead of `cli` (testpackage)
package cli
        ^
pkg/cli/map_flag_test.go:1:9: package should be `cli_test` instead of `cli` (testpackage)
package cli
        ^
pkg/cli/slice_flag_test.go:1:9: package should be `cli_test` instead of `cli` (testpackage)
package cli
        ^
pkg/cli/sort_test.go:1:9: package should be `cli_test` instead of `cli` (testpackage)
package cli
        ^
config/config_as_cty_test.go:18:1: Function TestTerragruntConfigAsCtyDrift missing the call to method parallel (paralleltest)
func TestTerragruntConfigAsCtyDrift(t *testing.T) {
^
config/config_as_cty_test.go:139:1: Function TestRemoteStateAsCtyDrift missing the call to method parallel (paralleltest)
func TestRemoteStateAsCtyDrift(t *testing.T) {
^
config/config_as_cty_test.go:179:1: Function TestTerraformConfigAsCtyDrift missing the call to method parallel (paralleltest)
func TestTerraformConfigAsCtyDrift(t *testing.T) {
^
config/config_helpers_test.go:219:2: Range statement for test TestRunCommand missing the call to method parallel in test Run (paralleltest)
	for _, testCase := range testCases {
	^
config/config_helpers_test.go:324:2: Range statement for test TestFindInParentFolders missing the call to method parallel in test Run (paralleltest)
	for _, testCase := range testCases {
	^
config/config_helpers_test.go:387:2: Range statement for test TestResolveTerragruntInterpolation missing the call to method parallel in test Run (paralleltest)
	for _, testCase := range testCases {
	^
config/config_helpers_test.go:483:2: Range statement for test TestResolveEnvInterpolationConfigString missing the call to method parallel in test Run (paralleltest)
	for _, testCase := range testCases {
	^
config/config_helpers_test.go:530:2: Range statement for test TestResolveCommandsInterpolationConfigString missing the call to method parallel in test Run (paralleltest)
	for _, testCase := range testCases {
	^
config/config_helpers_test.go:558:2: Range statement for test TestResolveCliArgsInterpolationConfigString missing the call to method parallel in test Run (paralleltest)
	for _, cliArgs := range [][]string{nil, {}, {"apply"}, {"plan", "-out=planfile"}} {
	^
config/config_helpers_test.go:783:2: Range statement for test TestTerraformBuiltInFunctions missing the call to method parallel in test Run (paralleltest)
	for _, testCase := range testCases {
	^
config/config_helpers_test.go:1021:2: Range statement for test TestGetTerragruntSourceForModuleHappyPath missing the call to method parallel in test Run (paralleltest)
	for _, testCase := range testCases {
	^
config/config_helpers_test.go:1052:2: Range statement for test TestStartsWith missing the call to method parallel in test Run (paralleltest)
	for id, testCase := range testCases {
	^
config/config_helpers_test.go:1082:2: Range statement for test TestEndsWith missing the call to method parallel in test Run (paralleltest)
	for id, testCase := range testCases {
	^
config/config_test.go:1223:1: Function TestIncludeFunctionsWorkInChildConfig missing the call to method parallel (paralleltest)
func TestIncludeFunctionsWorkInChildConfig(t *testing.T) {
^
config/config_test.go:1248:1: Function TestModuleDependenciesMerge missing the call to method parallel (paralleltest)
func TestModuleDependenciesMerge(t *testing.T) {
^
config/include_test.go:292:2: Range statement for test TestDeepMergeConfigIntoIncludedConfig missing the call to method parallel in test Run (paralleltest)
	for _, testCase := range testCases {
	^
config/include_test.go:307:1: Function TestConcurrentCopyFieldsMetadata missing the call to method parallel (paralleltest)
func TestConcurrentCopyFieldsMetadata(t *testing.T) {
^
config/cache_test.go:1:9: package should be `config_test` instead of `config` (testpackage)
package config
        ^
config/catalog_test.go:1:9: package should be `config_test` instead of `config` (testpackage)
package config
        ^
config/config_as_cty_test.go:1:9: package should be `config_test` instead of `config` (testpackage)
package config
        ^
config/config_helpers_test.go:1:9: package should be `config_test` instead of `config` (testpackage)
package config
        ^
config/config_partial_test.go:1:9: package should be `config_test` instead of `config` (testpackage)
package config
        ^
config/config_test.go:1:9: package should be `config_test` instead of `config` (testpackage)
package config
        ^
config/cty_helpers_test.go:1:9: package should be `config_test` instead of `config` (testpackage)
package config
        ^
config/dependency_test.go:1:9: package should be `config_test` instead of `config` (testpackage)
package config
        ^
config/include_test.go:1:9: package should be `config_test` instead of `config` (testpackage)
package config
        ^
config/locals_test.go:1:9: package should be `config_test` instead of `config` (testpackage)
package config
        ^
config/variable_test.go:1:9: package should be `config_test` instead of `config` (testpackage)
package config
        ^
config/config_helpers_test.go:742:6: TestTerraformBuiltInFunctions's subtests should call t.Parallel (tparallel)
func TestTerraformBuiltInFunctions(t *testing.T) {
     ^
config/include_test.go:160:6: TestDeepMergeConfigIntoIncludedConfig's subtests should call t.Parallel (tparallel)
func TestDeepMergeConfigIntoIncludedConfig(t *testing.T) {
     ^
config/config_helpers_test.go:241:6: TestFindInParentFolders's subtests should call t.Parallel (tparallel)
func TestFindInParentFolders(t *testing.T) {
     ^
config/config_helpers_test.go:1063:6: TestEndsWith's subtests should call t.Parallel (tparallel)
func TestEndsWith(t *testing.T) {
     ^
config/config_helpers_test.go:408:6: TestResolveEnvInterpolationConfigString's subtests should call t.Parallel (tparallel)
func TestResolveEnvInterpolationConfigString(t *testing.T) {
     ^
config/config_helpers_test.go:501:6: TestResolveCommandsInterpolationConfigString's subtests should call t.Parallel (tparallel)
func TestResolveCommandsInterpolationConfigString(t *testing.T) {
     ^
config/config_helpers_test.go:555:6: TestResolveCliArgsInterpolationConfigString's subtests should call t.Parallel (tparallel)
func TestResolveCliArgsInterpolationConfigString(t *testing.T) {
     ^
config/config_helpers_test.go:1033:6: TestStartsWith's subtests should call t.Parallel (tparallel)
func TestStartsWith(t *testing.T) {
     ^
config/config_helpers_test.go:160:6: TestRunCommand's subtests should call t.Parallel (tparallel)
func TestRunCommand(t *testing.T) {
     ^
config/config_helpers_test.go:340:6: TestResolveTerragruntInterpolation's subtests should call t.Parallel (tparallel)
func TestResolveTerragruntInterpolation(t *testing.T) {
     ^
config/config_helpers_test.go:1001:6: TestGetTerragruntSourceForModuleHappyPath's subtests should call t.Parallel (tparallel)
func TestGetTerragruntSourceForModuleHappyPath(t *testing.T) {
     ^
telemetry/metrics_test.go:17:1: Function TestNewMetricsExporter missing the call to method parallel (paralleltest)
func TestNewMetricsExporter(t *testing.T) {
^
telemetry/metrics_test.go:80:1: Function TestCleanMetricName missing the call to method parallel (paralleltest)
func TestCleanMetricName(t *testing.T) {
^
telemetry/traces_test.go:15:1: Function TestNewTraceExporter missing the call to method parallel (paralleltest)
func TestNewTraceExporter(t *testing.T) {
^
telemetry/metrics_test.go:1:9: package should be `telemetry_test` instead of `telemetry` (testpackage)
package telemetry
        ^
telemetry/traces_test.go:1:9: package should be `telemetry_test` instead of `telemetry` (testpackage)
package telemetry
        ^
terraform/getproviders/hash_test.go:1:9: package should be `getproviders_test` instead of `getproviders` (testpackage)
package getproviders
        ^
terraform/getproviders/package_authentication_test.go:1:9: package should be `getproviders_test` instead of `getproviders` (testpackage)
package getproviders
        ^
cli/commands/terraform/action_test.go:65:2: Range statement for test TestSetTerragruntInputsAsEnvVars missing the call to method parallel in test Run (paralleltest)
	for _, testCase := range testCases {
	^
cli/commands/terraform/action_test.go:112:2: Range statement for test TestTerragruntTerraformCodeCheck missing the call to method parallel in test Run (paralleltest)
	for _, testCase := range testCases {
	^
cli/commands/terraform/action_test.go:309:2: Range statement for test TestToTerraformEnvVars missing the call to method parallel in test Run (paralleltest)
	for _, testCase := range testCases {
	^
cli/commands/terraform/action_test.go:321:1: Function TestFilterTerraformExtraArgs missing the call to method parallel (paralleltest)
func TestFilterTerraformExtraArgs(t *testing.T) {
^
cli/commands/terraform/command_test.go:38:2: Range statement for test TestAction missing the call to method parallel in test Run (paralleltest)
	for _, tc := range tt {
	^
cli/commands/terraform/download_source_test.go:355:2: Range statement for test TestDownloadTerraformSourceFromLocalFolderWithManifest missing the call to method parallel in test Run (paralleltest)
	for _, testCase := range testCases {
	^
cli/commands/terraform/action_test.go:1:9: package should be `terraform_test` instead of `terraform` (testpackage)
package terraform
        ^
cli/commands/terraform/command_test.go:1:9: package should be `terraform_test` instead of `terraform` (testpackage)
package terraform
        ^
cli/commands/terraform/download_source_test.go:1:9: package should be `terraform_test` instead of `terraform` (testpackage)
package terraform
        ^
cli/commands/terraform/version_check_test.go:2:9: package should be `terraform_test` instead of `terraform` (testpackage)
package terraform
        ^
cli/commands/terraform/command_test.go:12:6: TestAction's subtests should call t.Parallel (tparallel)
func TestAction(t *testing.T) {
     ^
cli/commands/terraform/download_source_test.go:302:6: TestDownloadTerraformSourceFromLocalFolderWithManifest's subtests should call t.Parallel (tparallel)
func TestDownloadTerraformSourceFromLocalFolderWithManifest(t *testing.T) {
     ^
cli/commands/terraform/action_test.go:83:6: TestTerragruntTerraformCodeCheck's subtests should call t.Parallel (tparallel)
func TestTerragruntTerraformCodeCheck(t *testing.T) {
     ^
cli/commands/terraform/action_test.go:259:6: TestToTerraformEnvVars's subtests should call t.Parallel (tparallel)
func TestToTerraformEnvVars(t *testing.T) {
     ^
cli/commands/terraform/action_test.go:18:6: TestSetTerragruntInputsAsEnvVars's subtests should call t.Parallel (tparallel)
func TestSetTerragruntInputsAsEnvVars(t *testing.T) {
     ^
aws_helper/config_test.go:1:9: package should be `aws_helper_test` instead of `aws_helper` (testpackage)
package aws_helper
        ^
aws_helper/policy_test.go:1:9: package should be `aws_helper_test` instead of `aws_helper` (testpackage)
package aws_helper
        ^
remote/remote_state_s3_test.go:609:2: Range statement for test TestValidateS3Config missing the call to method parallel in test Run (paralleltest)
	for _, testCase := range testCases {
	^
remote/terraform_config_test.go:5:1: Function TestWrapMapToSingleLineHcl missing the call to method parallel (paralleltest)
func TestWrapMapToSingleLineHcl(t *testing.T) {
^
remote/terraform_config_test.go:23:2: Range statement for test TestWrapMapToSingleLineHcl missing the call to method parallel in test Run (paralleltest)
	for _, tt := range tests {
	^
remote/remote_state_gcs_test.go:1:9: package should be `remote_test` instead of `remote` (testpackage)
package remote
        ^
remote/remote_state_s3_test.go:1:9: package should be `remote_test` instead of `remote` (testpackage)
package remote
        ^
remote/remote_state_test.go:1:9: package should be `remote_test` instead of `remote` (testpackage)
package remote
        ^
remote/terraform_config_test.go:1:9: package should be `remote_test` instead of `remote` (testpackage)
package remote
        ^
remote/terraform_state_file_test.go:1:9: package should be `remote_test` instead of `remote` (testpackage)
package remote
        ^
remote/remote_state_s3_test.go:576:6: TestValidateS3Config's subtests should call t.Parallel (tparallel)
func TestValidateS3Config(t *testing.T) {
     ^
shell/error_explainer_test.go:42:2: Range statement for test TestExplainError missing the call to method parallel in test Run (paralleltest)
	for _, tt := range testCases {
	^
shell/run_shell_cmd_output_test.go:52:1: Function TestCommandOutputPrefix missing the call to method parallel (paralleltest)
func TestCommandOutputPrefix(t *testing.T) {
^
shell/error_explainer_test.go:1:9: package should be `shell_test` instead of `shell` (testpackage)
package shell
        ^
shell/run_shell_cmd_output_test.go:4:9: package should be `shell_test` instead of `shell` (testpackage)
package shell
        ^
shell/run_shell_cmd_test.go:1:9: package should be `shell_test` instead of `shell` (testpackage)
package shell
        ^
shell/run_shell_cmd_unix_test.go:4:9: package should be `shell_test` instead of `shell` (testpackage)
package shell
        ^
shell/error_explainer_test.go:13:6: TestExplainError's subtests should call t.Parallel (tparallel)
func TestExplainError(t *testing.T) {
     ^
terraform/getter_test.go:92:2: Range statement for test TestGetDownloadURLFromHeader missing the call to method parallel in test Run (paralleltest)
	for _, testCase := range testCases {
	^
terraform/getter_test.go:1:9: package should be `terraform_test` instead of `terraform` (testpackage)
package terraform
        ^
terraform/source_test.go:1:9: package should be `terraform_test` instead of `terraform` (testpackage)
package terraform
        ^
terraform/getter_test.go:36:6: TestGetDownloadURLFromHeader's subtests should call t.Parallel (tparallel)
func TestGetDownloadURLFromHeader(t *testing.T) {
     ^

@@ -21,7 +21,7 @@ import (
const MODULE_MANIFEST_NAME = ".terragrunt-module-manifest"

// file to indicate that init should be executed
const moduleInitRequiredFile = ".terragrunt-init-required"
const MODULE_INIT_REQUIRED_FILE = ".terragrunt-init-required"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unlike other languages, in GoLang we use camelcase to name constants. It would be nice to get rid of ALL CAPS someday, especially like this ones.

Naming convention
Example

This comment applies to all places where such changes are made.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we configure lint to report about Golang naming convention violations?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yup! There's a style preset. I'll either add that now, or in the next PR. I'm not sure how many findings will pop up.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I fixed the issues in this file. Do you mind if I don't search through the rest of the PR for instances like this, and instead resolve it when we get the style lint added?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Of course, do as you wish. Thanks!

@yhakbar yhakbar force-pushed the chore/adding-golangci-test-lints branch from cc6a59d to 01abe58 Compare August 14, 2024 12:17
Copy link

sonarcloud bot commented Aug 14, 2024

@yhakbar yhakbar marked this pull request as draft August 14, 2024 12:25
@yhakbar yhakbar marked this pull request as ready for review August 14, 2024 12:35
@yhakbar yhakbar merged commit 446f6df into master Aug 14, 2024
4 checks passed
@yhakbar yhakbar deleted the chore/adding-golangci-test-lints branch August 14, 2024 12:35
akrantz01 pushed a commit to akrantz01/homelab that referenced this pull request Aug 16, 2024
[![Mend
Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Update | Change |
|---|---|---|
|
[gruntwork-io/terragrunt](https://github.com/gruntwork-io/terragrunt)
| patch | `v0.66.6` -> `v0.66.8` |
|
[gruntwork-io/terragrunt](https://github.com/gruntwork-io/terragrunt)
| patch | `0.66.6` -> `0.66.8` |

---

### Release Notes

<details>
<summary>gruntwork-io/terragrunt (gruntwork-io/terragrunt)</summary>

###
[`v0.66.8`](https://github.com/gruntwork-io/terragrunt/releases/tag/v0.66.8)

[Compare
Source](https://github.com/gruntwork-io/terragrunt/compare/v0.66.7...v0.66.8)

#### What's Changed

- chore: Bumping go version used during builds to `1.22` by
[@&#8203;yhakbar](https://github.com/yhakbar) in
[gruntwork-io/terragrunt#3346

**Full Changelog**:
gruntwork-io/terragrunt@v0.66.7...v0.66.8

###
[`v0.66.7`](https://github.com/gruntwork-io/terragrunt/releases/tag/v0.66.7)

[Compare
Source](https://github.com/gruntwork-io/terragrunt/compare/v0.66.6...v0.66.7)

#### What's Changed

- fix: Reverting to asserts for non error checking assertions by
[@&#8203;yhakbar](https://github.com/yhakbar) in
[gruntwork-io/terragrunt#3341
- fix: Updated documentation for --terragrunt-graph-root by
[@&#8203;denis256](https://github.com/denis256) in
[gruntwork-io/terragrunt#3344
- fix: Fixing remote state init skip by
[@&#8203;yhakbar](https://github.com/yhakbar) in
[gruntwork-io/terragrunt#3345
- chore: Adding `test` Lint Presets by
[@&#8203;yhakbar](https://github.com/yhakbar) in
[gruntwork-io/terragrunt#3340

**Full Changelog**:
gruntwork-io/terragrunt@v0.66.6...v0.66.7

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined),
Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you
are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about these
updates again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR was generated by [Mend
Renovate](https://www.mend.io/free-developer-tools/renovate/). View the
[repository job
log](https://developer.mend.io/github/akrantz01/homelab).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzOC4yNi4xIiwidXBkYXRlZEluVmVyIjoiMzguMjYuMSIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOltdfQ==-->

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants