pulumi/pkg/codegen/nodejs
Abhinav Gupta 0bff0b8716 sdk/go: Remove 'nolint' directives from package docs
Go treats comments that match the following regex as directives.

    //[a-z0-9]+:[a-z0-9]

Comments that are directives don't show in an entity's documentation.
5a550b6951 (diff-f56160fd9fcea272966a8a1d692ad9f49206fdd8dbcbfe384865a98cd9bc2749R165)

Our code has `//nolint` directives that now show in the API Reference.
This is because these directives are in one of the following forms,
which don't get this special treatment.

    // nolint:foo
    //nolint: foo

This change fixes all such directives found by the regex:
`// nolint|//nolint: `.
See bottom of commit for command used for the fix.

Verification:
Here's the output of `go doc` on some entities
before and after this change.

Before
```
% go doc github.com/pulumi/pulumi/sdk/v3/go/pulumi | head -n8
package pulumi // import "github.com/pulumi/pulumi/sdk/v3/go/pulumi"

nolint: lll, interfacer

nolint: lll, interfacer

const EnvOrganization = "PULUMI_ORGANIZATION" ...
var ErrPlugins = errors.New("pulumi: plugins requested")
```

After
```
% go doc github.com/pulumi/pulumi/sdk/v3/go/pulumi | head -n8
package pulumi // import "github.com/pulumi/pulumi/sdk/v3/go/pulumi"

const EnvOrganization = "PULUMI_ORGANIZATION" ...
var ErrPlugins = errors.New("pulumi: plugins requested")
func BoolRef(v bool) *bool
func Float64Ref(v float64) *float64
func IntRef(v int) *int
func IsSecret(o Output) bool
```

Before
```
% go doc github.com/pulumi/pulumi/sdk/v3/go/pulumi URN_
package pulumi // import "github.com/pulumi/pulumi/sdk/v3/go/pulumi"

func URN_(o string) ResourceOption
    URN_ is an optional URN of a previously-registered resource of this type to
    read from the engine. nolint: revive
```

After:
```
% go doc github.com/pulumi/pulumi/sdk/v3/go/pulumi URN_
package pulumi // import "github.com/pulumi/pulumi/sdk/v3/go/pulumi"

func URN_(o string) ResourceOption
    URN_ is an optional URN of a previously-registered resource of this type to
    read from the engine.
```

Note that golangci-lint offers a 'nolintlint'  linter
that finds such miuses of nolint,
but it also finds other issues so I've deferred that to a follow up PR.

Resolves #11785

Related: https://github.com/golangci/golangci-lint/issues/892

[git-generate]
FILES=$(mktemp)
rg -l '// nolint|//nolint: ' |
  tee "$FILES" |
  xargs perl -p -i -e '
    s|// nolint|//nolint|g;
    s|//nolint: |//nolint:|g;
  '
rg '.go$' < "$FILES" | xargs gofmt -w -s
2023-01-06 09:06:47 -08:00
..
gen_program_test Test transpiled examples for all languages 2022-11-01 11:23:14 -07:00
doc.go sdk/go: Remove 'nolint' directives from package docs 2023-01-06 09:06:47 -08:00
doc_test.go sdk/go: Remove 'nolint' directives from package docs 2023-01-06 09:06:47 -08:00
gen.go sdk/go: Remove 'nolint' directives from package docs 2023-01-06 09:06:47 -08:00
gen_fileinfo.go [codegen/node] Implement support for lazy-loaded Node modules (#10538) 2022-09-01 18:42:44 -04:00
gen_intrinsics.go Update error handling (#8406) 2021-11-12 18:37:17 -08:00
gen_lazyloads.go Remove state from lazyLoadGen 2022-09-28 10:47:42 -04:00
gen_lazyloads_test.go sdk/go: Remove 'nolint' directives from package docs 2023-01-06 09:06:47 -08:00
gen_program.go Don't use *schema.Package in nodejs codegen 2022-12-08 17:49:54 +01:00
gen_program_expressions.go Revert "Simplified invokes: SDK-gen and program-gen implementation for dotnet and nodejs" 2022-12-20 17:47:29 -08:00
gen_program_lower.go [codegen] Rename the PCL package. (#8103) 2021-09-29 20:11:56 -07:00
gen_program_test.go fix(ci): Split programgen tests over more jobs 2022-10-16 23:20:45 -07:00
gen_program_utils.go Implemented filebase64sha256 & fileArchive support for codegen (#7997) 2022-01-21 16:03:25 +02:00
gen_test.go sdk/go: Remove 'nolint' directives from package docs 2023-01-06 09:06:47 -08:00
importer.go [codegen/node] Implement support for lazy-loaded Node modules (#10538) 2022-09-01 18:42:44 -04:00
test.go fix(ci): Split programgen tests over more jobs 2022-10-16 23:20:45 -07:00
utilities.go [codegen/node] Implement support for lazy-loaded Node modules (#10538) 2022-09-01 18:42:44 -04:00
utilities_test.go sdk/go: Remove 'nolint' directives from package docs 2023-01-06 09:06:47 -08:00