pulumi/pkg/codegen/schema
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
..
README.md Document code generation concepts (#17162) 2024-09-05 13:12:59 +00:00
bind.go Enable some more linting rules (#17456) 2024-10-03 17:37:13 +00:00
docs_parser.go Enable goheader rule and add missing license headers (#15473) 2024-09-09 12:05:45 +00:00
docs_renderer.go Enable goheader rule and add missing license headers (#15473) 2024-09-09 12:05:45 +00:00
docs_test.go Enable goheader rule and add missing license headers (#15473) 2024-09-09 12:05:45 +00:00
loader.go Fix check for disableEntryCache in newPluginLoaderWithOptions (#17314) 2024-09-20 10:35:08 +00:00
loader_cached.go Split caching logic into it's own type to use with LoaderClient (#17118) 2024-08-31 13:25:20 +00:00
loader_cached_test.go Split caching logic into it's own type to use with LoaderClient (#17118) 2024-08-31 13:25:20 +00:00
loader_client.go Support loading parameterized schemas in the schema loader (#17108) 2024-08-30 14:25:29 +00:00
loader_js.go [display] Enable WASM compilation (#16246) 2024-05-24 20:27:56 +00:00
loader_mmap.go [display] Enable WASM compilation (#16246) 2024-05-24 20:27:56 +00:00
loader_schema_test.go Enable goheader rule and add missing license headers (#15473) 2024-09-09 12:05:45 +00:00
loader_server.go Add schema loader service 2023-07-27 15:03:52 +01:00
loader_test.go Have `Host.Provider` accept a `PackageDescriptor` (#17244) 2024-09-12 13:17:30 +00:00
mock_pulumi_schema.go Enable goheader rule and add missing license headers (#15473) 2024-09-09 12:05:45 +00:00
package_reference.go Enable goheader rule and add missing license headers (#15473) 2024-09-09 12:05:45 +00:00
pulumi.json Change parameterization in schemas to base64 strings (#16614) 2024-07-10 15:36:05 +00:00
schema.go Prepare golangci-lint upgrade (#17065) 2024-08-28 07:57:38 +00:00
schema_test.go [schema] Validate version is provided when package supports packing (#17420) 2024-09-28 23:56:17 +00:00

README.md

(schema)=

Pulumi Schema

This package defines Pulumi Schema, a language-neutral specification for cloud resource models. Pulumi Schema is the interface definition language for all Pulumi Packages, and is used as the input to SDK code generation for each supported Pulumi language.