pulumi/pkg/codegen/python
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
.gitignore Simplify output-funcs codegen test (#8039) 2021-09-23 13:42:20 -04:00
doc.go Generate TypedDicts for python inputs (#15957) 2024-06-18 15:24:42 +00:00
gen.go Enable some more linting rules (#17456) 2024-10-03 17:37:13 +00:00
gen_intrinsics.go ci: gofmt 1.18+ clean 2022-09-21 09:48:39 -07:00
gen_program.go Test pyright and mypy in python conformance tests (#17354) 2024-09-30 23:38:39 +00:00
gen_program_expressions.go Enable some more linting rules (#17456) 2024-10-03 17:37:13 +00:00
gen_program_lower.go Enable goheader rule and add missing license headers (#15473) 2024-09-09 12:05:45 +00:00
gen_program_quotes.go Enable goheader rule and add missing license headers (#15473) 2024-09-09 12:05:45 +00:00
gen_program_quotes_test.go Enable goheader rule and add missing license headers (#15473) 2024-09-09 12:05:45 +00:00
gen_program_test.go Test pyright and mypy in python conformance tests (#17354) 2024-09-30 23:38:39 +00:00
gen_program_utils.go Enable goheader rule and add missing license headers (#15473) 2024-09-09 12:05:45 +00:00
gen_resource_mappings.go Use slice.Prealloc instead of make([]T, 0, ...) 2023-06-29 11:27:50 +01:00
gen_resource_mappings_test.go Enable goheader rule and add missing license headers (#15473) 2024-09-09 12:05:45 +00:00
gen_test.go [sdk-gen/node/python] Bump minimum valid SDK to v3.134.1 so that output-invokes work and maintain secrets (#17390) 2024-09-26 17:45:27 +00:00
importer.go Generate TypedDict input types by default (#16704) 2024-07-23 11:26:54 +00:00
pyproject.go Enable goheader rule and add missing license headers (#15473) 2024-09-09 12:05:45 +00:00
python.go ci: gofmt 1.18+ clean 2022-09-21 09:48:39 -07:00
python_test.go Enable goheader rule and add missing license headers (#15473) 2024-09-09 12:05:45 +00:00
requirements.txt Fully generate TypedDict input types by default (#17296) 2024-09-20 17:16:14 +00:00
test.go Enable goheader rule and add missing license headers (#15473) 2024-09-09 12:05:45 +00:00
utilities.go Enable goheader rule and add missing license headers (#15473) 2024-09-09 12:05:45 +00:00
utilities.py Replace asyncio.ensure_future with create_task (#17406) 2024-09-30 12:53:15 +00:00
utilities_test.go Enable goheader rule and add missing license headers (#15473) 2024-09-09 12:05:45 +00:00