pulumi/pkg/codegen/dotnet
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
..
gen_program_test Enable goheader rule and add missing license headers (#15473) 2024-09-09 12:05:45 +00:00
doc.go Enable perfsprint linter (#14813) 2023-12-12 12:19:42 +00:00
doc_test.go sdk/go: Remove 'nolint' directives from package docs 2023-01-06 09:06:47 -08:00
gen.go Enable some more linting rules (#17456) 2024-10-03 17:37:13 +00:00
gen_intrinsics.go [breaking] Changing the version of go.mod in sdk / pkg to be v3 2021-04-14 19:32:18 +01:00
gen_program.go Enable some more linting rules (#17456) 2024-10-03 17:37:13 +00:00
gen_program_expressions.go Enable some more linting rules (#17456) 2024-10-03 17:37:13 +00:00
gen_program_test.go Enable goheader rule and add missing license headers (#15473) 2024-09-09 12:05:45 +00:00
gen_test.go Enable goheader rule and add missing license headers (#15473) 2024-09-09 12:05:45 +00:00
git_ignore.go Add GenerateProject to codegen (#9475) 2022-04-29 17:04:04 +01:00
importer.go feat: Add support for language specific settings for resources (#14308) 2023-11-29 16:35:08 +00:00
templates.go [sdk-gen] Support parameterized .NET provider SDKs (#16912) 2024-08-09 13:16:20 +00:00
test.go Enable goheader rule and add missing license headers (#15473) 2024-09-09 12:05:45 +00:00
utilities.go Fix up local dependencies in .NET codegen (#16902) 2024-08-09 14:43:51 +00:00
utilities_test.go Enable goheader rule and add missing license headers (#15473) 2024-09-09 12:05:45 +00:00