pulumi/sdk/go/common/resource
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
..
archive Prepare golangci-lint upgrade (#17065) 2024-08-28 07:57:38 +00:00
asset Add asset/archive to conformance tests and fix engine working dir issues (#16100) 2024-05-02 11:32:54 +00:00
config Enable goheader rule and add missing license headers (#15473) 2024-09-09 12:05:45 +00:00
plugin Enable some more linting rules (#17456) 2024-10-03 17:37:13 +00:00
sig Move assets and archives to their own package (#15157) 2024-01-25 20:39:31 +00:00
testing Enable goheader rule and add missing license headers (#15473) 2024-09-09 12:05:45 +00:00
urn rewrite the URN when resources are being moved between projects (#16523) 2024-07-01 17:36:11 +00:00
alias.go Enable goheader rule and add missing license headers (#15473) 2024-09-09 12:05:45 +00:00
asset.go Add asset archive test to conformance tests (#16455) 2024-06-24 14:23:18 +00:00
asset_test.go Deserialize Assets with their Sig (#16073) 2024-04-26 19:05:50 +00:00
custom_timeouts.go Enable goheader rule and add missing license headers (#15473) 2024-09-09 12:05:45 +00:00
errors.go [breaking] Changing the version of go.mod in sdk / pkg to be v3 2021-04-14 19:32:18 +01:00
mapper_test.go Move assets and archives to their own package (#15157) 2024-01-25 20:39:31 +00:00
properties.go Flow PropertyValues through NewPropertyMapFromMap (#16894) 2024-08-07 06:50:58 +00:00
properties_diff.go A property.Value implementation to replace resource.PropertyValue (#15145) 2024-03-14 19:58:59 +00:00
properties_diff_test.go Move assets and archives to their own package (#15157) 2024-01-25 20:39:31 +00:00
properties_path.go Enable goheader rule and add missing license headers (#15473) 2024-09-09 12:05:45 +00:00
properties_path_test.go Enable goheader rule and add missing license headers (#15473) 2024-09-09 12:05:45 +00:00
properties_test.go Flow PropertyValues through NewPropertyMapFromMap (#16894) 2024-08-07 06:50:58 +00:00
property_compatibility.go Property map keys are just strings (#15767) 2024-03-25 17:26:41 +00:00
property_compatibility_test.go A property.Value implementation to replace resource.PropertyValue (#15145) 2024-03-14 19:58:59 +00:00
resource_goal.go Allow anything in resource names (#14107) 2023-11-20 08:59:00 +00:00
resource_id.go Remove unused resource.NewUniqueHexV2 (#17067) 2024-08-26 10:48:25 +00:00
resource_id_test.go Enable some more linting rules (#17456) 2024-10-03 17:37:13 +00:00
resource_operation.go move pkg/resource -> sdk/go/common/resource, but leave nested resource packages 2020-03-18 13:36:19 -07:00
resource_state.go Centralize resource state dependency traversal (#17320) 2024-09-23 08:37:34 +00:00
resource_state_test.go Centralize resource state dependency traversal (#17320) 2024-09-23 08:37:34 +00:00
stack.go Move resource.URN to urn.URN (#15689) 2024-03-14 15:28:32 +00:00
status.go move pkg/resource -> sdk/go/common/resource, but leave nested resource packages 2020-03-18 13:36:19 -07:00
urn.go Move resource.URN to urn.URN (#15689) 2024-03-14 15:28:32 +00:00