mirror of https://github.com/pulumi/pulumi.git
7efd298867
11829: golangci-lint: Don't disable megacheck r=abhinav a=abhinav As a pre-step to enabling staticcheck (#11808) drop megacheck from the list of disabled linters. This was suppressing the output of some other linters that are enabled by default including gosimple and unused. ## Issues fixed ### pkg ``` cmd/pulumi/preview.go:199:4: S1011: should replace loop with `targetURNs = append(targetURNs, targets...)` (gosimple) cmd/pulumi/preview.go:204:4: S1011: should replace loop with `replaceURNs = append(replaceURNs, replaces...)` (gosimple) cmd/pulumi/refresh.go:248:4: S1011: should replace loop with `targetUrns = append(targetUrns, *targets...)` (gosimple) cmd/pulumi/up.go:130:3: S1011: should replace loop with `targetURNs = append(targetURNs, targets...)` (gosimple) cmd/pulumi/up.go:134:3: S1011: should replace loop with `replaceURNs = append(replaceURNs, replaces...)` (gosimple) resource/stack/deployment.go:61:5: var `resourceSchema` is unused (unused) codegen/hcl2/model/pretty/display.go:227:6: S1003: should use strings.ContainsRune(v, '\n') instead (gosimple) codegen/hcl2/model/pretty/display.go:289:6: S1003: should use strings.ContainsRune(v, '\n') instead (gosimple) codegen/nodejs/gen.go:110:2: S1029: should range over string, not []rune(string) (gosimple) codegen/nodejs/gen_program.go:381:2: S1008: should use 'return makeValidIdentifier(outputName) != outputName' instead of 'if makeValidIdentifier(outputName) != outputName { return true }; return false' (gosimple) codegen/go/gen_program_json.go:30:2: field `temps` is unused (unused) codegen/go/gen_program_json.go:34:24: func `(*jsonSpiller).spillExpression` is unused (unused) codegen/go/gen_program_json.go:12:6: type `jsonTemp` is unused (unused) codegen/go/gen_program_expressions.go:542:21: func `(*generator).genRelativeTraversalExpression` is unused (unused) codegen/go/gen_program_json.go:21:21: func `(*jsonTemp).Traverse` is unused (unused) codegen/go/gen_program_json.go:31:2: field `count` is unused (unused) codegen/go/gen_program.go:484:21: func `(*generator).getPkgContext` is unused (unused) codegen/go/gen_program_json.go:17:21: func `(*jsonTemp).Type` is unused (unused) codegen/go/gen_program_json.go:25:21: func `(*jsonTemp).SyntaxNode` is unused (unused) codegen/go/gen_test.go:399:4: S1023: redundant break statement (gosimple) codegen/python/gen_program.go:337:41: S1040: type assertion to the same type: destType already has type model.Type (gosimple) backend/display/jsonmessage.go:176:27: func `(*messageRenderer).writeBlankLine` is unused (unused) backend/display/progress.go:1239:21: S1012: should use `time.Since` instead of `time.Now().Sub` (gosimple) codegen/hcl2/syntax/tokens.go:265:2: S1001: should use copy() instead of a loop (gosimple) testing/integration/util.go:195:2: S1006: should use for {} instead of for true {} (gosimple) testing/integration/program.go:456:3: S1011: should replace loop with `opts.OrderedConfig = append(opts.OrderedConfig, overrides.OrderedConfig...)` (gosimple) testing/integration/program.go:690:3: S1038: should use t.Skipf(...) instead of t.Skip(fmt.Sprintf(...)) (gosimple) codegen/dotnet/gen_program.go:255:21: func `(*generator).warnf` is unused (unused) codegen/dotnet/gen.go:62:2: S1017: should replace this `if` statement with an unconditional `strings.TrimPrefix` (gosimple) codegen/dotnet/gen_program.go:515:41: S1040: type assertion to the same type: destType already has type model.Type (gosimple) codegen/schema/loader.go:116:9: S1039: unnecessary use of fmt.Sprintf (gosimple) ``` ### sdk ``` python/cmd/pulumi-language-python/main.go:532:3: S1029: should range over string, not []rune(string) (gosimple) go/common/resource/plugin/context.go:145:8: S1005: unnecessary assignment to the blank identifier (gosimple) go/common/resource/plugin/context.go:144:3: S1000: should use a simple channel send/receive instead of `select` with a single case (gosimple) go/common/util/env/env.go:198:9: S1025: the argument is already a string, there's no need to use fmt.Sprintf (gosimple) go/pulumi/resource_set.go:9:22: func `resourceSet.any` is unused (unused) go/pulumi/resource_set.go:17:22: func `resourceSet.has` is unused (unused) go/pulumi/resource_set.go:13:22: func `resourceSet.delete` is unused (unused) go/pulumi/types_test.go:444:12: S1040: type assertion to the same type: argsV.R already has type Resource (gosimple) go/auto/stack.go:153:2: S1021: should merge variable declaration with assignment on next line (gosimple) go/auto/stack.go:170:2: S1021: should merge variable declaration with assignment on next line (gosimple) go/common/resource/asset_test.go:391:6: func `findRepositoryRoot` is unused (unused) go/common/util/goversion/version.go:32:2: S1017: should replace this `if` statement with an unconditional `strings.TrimPrefix` (gosimple) ``` ### tests There were a couple functions marked unused that are used by tests that are currently skipped. I've added `//nolint:unused` for those. 11833: crypto/ssh/terminal is deprecated r=abhinav a=abhinav golang.org/x/crypto/ssh/terminal is deprecated. golang.org/x/term is a near drop-in replacement for it. In service to #11808 Co-authored-by: Abhinav Gupta <abhinav@pulumi.com> |
||
---|---|---|
.. | ||
about | ||
aliases | ||
cloud_secrets_provider | ||
component_provider_schema | ||
config_basic | ||
config_capture_e2e/nodejs | ||
config_secrets_warn | ||
construct_component | ||
construct_component_error_apply | ||
construct_component_methods | ||
construct_component_methods_errors | ||
construct_component_methods_resources | ||
construct_component_methods_unknown | ||
construct_component_output_values | ||
construct_component_plain | ||
construct_component_provider | ||
construct_component_slow | ||
construct_component_unknown | ||
construct_nested_component/go | ||
custom_timeouts | ||
delete_before_create | ||
dependency_steps | ||
double_pending_delete | ||
duplicate_urns | ||
dynamic | ||
ee_perf | ||
empty | ||
enums | ||
exclude_protected | ||
explicit_provider | ||
gather_plugin | ||
get_created | ||
get_resource | ||
go | ||
invalid_package_json | ||
large_resource | ||
nodejs | ||
partial_state | ||
partial_values | ||
policy | ||
printf | ||
project_main | ||
project_main_abs | ||
project_main_parent/foo | ||
protect_resources | ||
provider_secret_config | ||
python | ||
python_await | ||
query | ||
read | ||
recreate_resource_check | ||
refresh/go | ||
resource_refs_get_resource | ||
rotate_passphrase | ||
secret_outputs | ||
single_resource | ||
stack_bad_parenting | ||
stack_dependencies | ||
stack_outputs | ||
stack_parenting | ||
stack_project_name | ||
stack_reference | ||
stack_reference_multi/python | ||
stack_reference_secrets/nodejs | ||
steps | ||
targets | ||
transformations | ||
tsconfig | ||
types | ||
unsafe_snapshot_tests/bad_resource | ||
.gitignore | ||
appdash_test.go | ||
component_setup.sh | ||
integration_go_smoke_test.go | ||
integration_go_test.go | ||
integration_nodejs_smoke_test.go | ||
integration_nodejs_test.go | ||
integration_python_smoke_test.go | ||
integration_python_test.go | ||
integration_smoke_test.go | ||
integration_test.go | ||
integration_util_test.go |