pulumi/sdk/go/common/resource/plugin
Will Jones c496921d44
Enable some more linting rules (#17456)
Issue #10659 lists a number of extra linting checks that we could enable
in order to make our Go code more robust. This commit implements as many
as seem sensible:

* `durationcheck`, which checks for multiplication of `time.Duration`s,
which can lead to unexpected behaviour (e.g. `time.Second * time.Second`
is *not* one second)
* `goprintffuncname`, which checks that `Printf`-like functions are
appropriately suffixed with `f` to indicate as such
* `tenv`, which checks for `os.Setenv` in tests where `t.Setenv` is
generally a better solution
* `wastedassign`, which checks for assignments whose values are never
used (such as initial values before an `if` where both branches then
overwrite the value)
* `whitespace`, which checks for blank lines at the beginning and end of
blocks such as functions, `if`s, `for`s and so on.

This commit does *not* enable the following checks listed in #10659:

* `wrapcheck`, which insists that third-party library errors are always
`%w`rapped -- we have a lot of cases where we don't do this and it's
probably a bit more involved than "just wrap them" in terms of making
sure we don't break anything (maybe)
* `predeclared`, which checks for shadowing of existing Go identifiers
-- we use `old` and `new` a lot, especially in step generation, so this
is probably a slightly bigger clean-up/one we might want to opt out of
* `mnd` (magic number detection) -- we have a lot of failures on this
* `nilnil` -- we only have a couple of failures on this; these could
probably be handled with `//nolint` but for now I've opted not to take
this route.
2024-10-03 17:37:13 +00:00
..
analyzer.go Allow anything in resource names (#14107) 2023-11-20 08:59:00 +00:00
analyzer_plugin.go Replace pkg/errors.Wrap with fmt.Errorf (#17201) 2024-09-09 11:11:46 +00:00
check.go Enable importas linter (#15167) 2024-01-17 14:56:37 +00:00
config_source.go [breaking] Changing the version of go.mod in sdk / pkg to be v3 2021-04-14 19:32:18 +01:00
context.go implement the engine bits for debugging support (#17072) 2024-08-30 10:31:28 +00:00
context_test.go Fix data race in plugin.Context 2023-03-31 07:15:11 -07:00
converter.go Plumb Remote, Component, and LogicalName into the import plugin system (#15199) 2024-01-24 17:15:30 +00:00
converter_plugin.go Refactor: move plugin kind to apitype (#15946) 2024-04-25 17:30:30 +00:00
converter_plugin_test.go Plumb Remote, Component, and LogicalName into the import plugin system (#15199) 2024-01-24 17:15:30 +00:00
converter_server.go Plumb Remote, Component, and LogicalName into the import plugin system (#15199) 2024-01-24 17:15:30 +00:00
converter_server_test.go Plumb Remote, Component, and LogicalName into the import plugin system (#15199) 2024-01-24 17:15:30 +00:00
debugging.go implement the engine bits for debugging support (#17072) 2024-08-30 10:31:28 +00:00
diagnostic.go Prepare golangci-lint upgrade (#17065) 2024-08-28 07:57:38 +00:00
diagnostic_test.go Allow converter plugins to return diagnostics 2023-06-05 17:38:59 +01:00
doc.go Enable goheader rule and add missing license headers (#15473) 2024-09-09 12:05:45 +00:00
host.go Have `Host.Provider` accept a `PackageDescriptor` (#17244) 2024-09-12 13:17:30 +00:00
host_server.go Replace pkg/errors.Wrap with fmt.Errorf (#17201) 2024-09-09 11:11:46 +00:00
host_test.go Lock access to the plugin loading channels 2023-08-10 23:40:23 +01:00
langruntime.go debugging: more consistency for naming (#17152) 2024-09-04 10:36:45 +00:00
langruntime_plugin.go Lookup language plugin versions by querying the plugin (#17216) 2024-09-10 21:38:36 +00:00
langruntime_test.go Add not-found markers to missing executables for packagemanagers (#16488) 2024-06-28 23:21:55 +00:00
mock.go Have `Host.Provider` accept a `PackageDescriptor` (#17244) 2024-09-12 13:17:30 +00:00
plugin.go Enable some more linting rules (#17456) 2024-10-03 17:37:13 +00:00
plugin_test.go Revert "resource/plugin: Shut down plugins gracefully (#13795)" (#13844) 2023-08-31 16:29:55 +00:00
provider.go Send resource name and type as well as URN to providers (#17177) 2024-09-06 09:29:37 +00:00
provider_plugin.go Enable some more linting rules (#17456) 2024-10-03 17:37:13 +00:00
provider_plugin_test.go Enable goheader rule and add missing license headers (#15473) 2024-09-09 12:05:45 +00:00
provider_server.go Send resource name and type as well as URN to providers (#17177) 2024-09-06 09:29:37 +00:00
provider_server_test.go Enable goheader rule and add missing license headers (#15473) 2024-09-09 12:05:45 +00:00
provider_test.go Fix PropertyPaths generated by NewDetailedDiffFromObjectDiff (#14337) 2023-10-25 10:39:03 +00:00
provider_unimplemented.go Normalize plugin.Provider methods to (Context, Request) -> (Response, error) (#16302) 2024-06-07 19:47:49 +00:00
rpc.go Replace pkg/errors.Wrap with fmt.Errorf (#17201) 2024-09-09 11:11:46 +00:00
rpc_rapid_test.go Remove deprecated Protobufs imports (#15158) 2024-01-17 09:35:20 +00:00
rpc_test.go Fix upgrade with ResourceReference (#15377) 2024-02-06 08:22:46 +00:00
server.go Add mapping service to converter 2023-03-24 17:09:17 +00:00