pulumi/pkg
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
..
asset Move some asset code to pkg (#15162) 2024-01-17 11:30:37 +00:00
authhelpers Enable goheader rule and add missing license headers (#15473) 2024-09-09 12:05:45 +00:00
backend Enable some more linting rules (#17456) 2024-10-03 17:37:13 +00:00
cmd/pulumi Enable some more linting rules (#17456) 2024-10-03 17:37:13 +00:00
codegen Enable some more linting rules (#17456) 2024-10-03 17:37:13 +00:00
display Move sdk/go/common/display to /pkg/display (#13954) 2023-09-18 11:01:28 +00:00
engine Enable some more linting rules (#17456) 2024-10-03 17:37:13 +00:00
graph Support topologically sorting snapshots (#17403) 2024-10-01 08:45:35 +00:00
importer [cli/import] Fix undefined variable errors in code generation when imported resources use a parent or provider (#16786) 2024-07-25 13:53:44 +00:00
operations Move resource.URN to urn.URN (#15689) 2024-03-14 15:28:32 +00:00
resource Enable some more linting rules (#17456) 2024-10-03 17:37:13 +00:00
secrets Enable some more linting rules (#17456) 2024-10-03 17:37:13 +00:00
testing/integration Enable some more linting rules (#17456) 2024-10-03 17:37:13 +00:00
util Enable goheader rule and add missing license headers (#15473) 2024-09-09 12:05:45 +00:00
version duplicate version to ensure linking is properly handled 2020-03-19 12:49:34 -07:00
workspace Enable goheader rule and add missing license headers (#15473) 2024-09-09 12:05:45 +00:00
README.md export codegen tests for internal use (#8928) 2022-02-07 12:10:04 +01:00
go.mod fix dll loading errors in windows CI (#17410) 2024-10-02 08:43:42 +00:00
go.sum fix dll loading errors in windows CI (#17410) 2024-10-02 08:43:42 +00:00

README.md

pulumi/pkg

While pulumi/sdk maintains strict backwards compatibility guarantees, code under pkg/ is handled more informally: while breaking changes are still discouraged they may happen when they make sense.