-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Enable
gci
linter to sort and group imports (#776)
This PR adds the [gci linter](https://github.com/daixiang0/gci) to the enabled Go linters. Additionally adds a `lint_provider.fix` Make target that maintainers may run locally to help fix linting errors. The custom order for the import blocks is defined as follows: - standard library imports - blank imports - default imports - pulumi/* imports - local imports (i.e. within the provider repo itself. A typical import section in `resources.go` would look like this: ``` package cloudinit import ( "fmt" "path/filepath" "unicode" // embed is used to store bridge-metadata.json in the compiled binary _ "embed" "github.com/hashicorp/terraform-provider-cloudinit/shim" pf "github.com/pulumi/pulumi-terraform-bridge/pf/tfbridge" "github.com/pulumi/pulumi-terraform-bridge/v3/pkg/tfbridge" tfbridgetokens "github.com/pulumi/pulumi-terraform-bridge/v3/pkg/tfbridge/tokens" "github.com/pulumi/pulumi/sdk/v3/go/common/tokens" "github.com/pulumi/pulumi-cloudinit/provider/pkg/version" ) ``` Notice that this change needs a focused migration, as on providers with strict linting, it will cause a failure in CI. The proposed plan is to merge this PR and run a script that checks out each provider repo, runs `make ci-mgmt && golanci-lint --fix`, commit, push, and automerge.
- Loading branch information
1 parent
db345d6
commit 4372b1f
Showing
8 changed files
with
60 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters