-
Notifications
You must be signed in to change notification settings - Fork 1
chore: Upgrades golangci-lint to v2 #41
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 4 commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,107 +1,96 @@ | ||
linters-settings: | ||
gocritic: | ||
enabled-tags: | ||
- diagnostic | ||
- experimental | ||
- opinionated | ||
- performance | ||
- style | ||
govet: | ||
enable-all: true | ||
|
||
revive: | ||
# see https://github.com/mgechev/revive#available-rules for details. | ||
ignore-generated-header: true | ||
severity: warning | ||
rules: | ||
- name: blank-imports | ||
- name: context-as-argument | ||
- name: context-keys-type | ||
- name: dot-imports | ||
- name: error-return | ||
- name: error-strings | ||
- name: error-naming | ||
- name: errorf | ||
- name: exported | ||
- name: indent-error-flow | ||
- name: if-return | ||
- name: increment-decrement | ||
- name: var-naming | ||
- name: var-declaration | ||
- name: package-comments | ||
- name: range | ||
- name: receiver-naming | ||
- name: time-naming | ||
- name: unexported-return | ||
- name: indent-error-flow | ||
- name: errorf | ||
- name: empty-block | ||
- name: superfluous-else | ||
- name: struct-tag | ||
# Too many unusued parameters, skipping this check for now | ||
#- name: unused-parameter | ||
- name: unreachable-code | ||
- name: redefines-builtin-id | ||
misspell: | ||
locale: US | ||
ignore-words: | ||
- cancelled | ||
lll: | ||
# Default is 120. '\t' is counted as 1 character. | ||
# set our project to 500, as we are adding open api field description in the schema. | ||
# also, for anyone using vscode, use the following configs: | ||
# "rewrap.wrappingColumn": 500 ... requires the rewrap plugin | ||
# "editor.rulers": [500] | ||
line-length: 500 | ||
nestif: | ||
# minimal complexity of if statements to report, 5 by default | ||
min-complexity: 7 | ||
mnd: | ||
checks: | ||
- case | ||
- operation | ||
- return | ||
funlen: | ||
lines: 360 | ||
statements: 120 | ||
version: "2" | ||
run: | ||
modules-download-mode: readonly | ||
tests: true | ||
linters: | ||
disable-all: true | ||
default: none | ||
enable: | ||
- copyloopvar | ||
- dogsled | ||
- errcheck | ||
- exhaustive | ||
- funlen | ||
- gocritic | ||
- gofmt | ||
- goimports | ||
- revive | ||
- mnd | ||
- goprintffuncname | ||
- gosec | ||
- gosimple | ||
- govet | ||
- ineffassign | ||
- lll | ||
- makezero | ||
- misspell | ||
- mnd | ||
- nakedret | ||
- noctx | ||
- nolintlint | ||
- revive | ||
- rowserrcheck | ||
- copyloopvar | ||
- staticcheck | ||
- stylecheck | ||
- typecheck | ||
- unconvert | ||
- unused | ||
- whitespace | ||
- thelper | ||
- testifylint | ||
- exhaustive | ||
- makezero | ||
- noctx | ||
- testpackage | ||
- thelper | ||
- unconvert | ||
- unused | ||
- usetesting | ||
run: | ||
timeout: 10m | ||
tests: true | ||
build-tags: | ||
- integration | ||
modules-download-mode: readonly | ||
- whitespace | ||
settings: | ||
funlen: | ||
lines: 360 | ||
statements: 120 | ||
gocritic: | ||
enabled-tags: | ||
- diagnostic | ||
- experimental | ||
- opinionated | ||
- performance | ||
- style | ||
govet: | ||
enable-all: true | ||
misspell: | ||
locale: US | ||
mnd: | ||
checks: | ||
- case | ||
- operation | ||
- return | ||
nestif: | ||
min-complexity: 7 | ||
revive: | ||
severity: warning | ||
rules: | ||
- name: blank-imports | ||
- name: context-as-argument | ||
- name: context-keys-type | ||
- name: dot-imports | ||
- name: error-return | ||
- name: error-strings | ||
- name: error-naming | ||
- name: errorf | ||
- name: exported | ||
- name: indent-error-flow | ||
- name: if-return | ||
- name: increment-decrement | ||
- name: var-naming | ||
- name: var-declaration | ||
- name: package-comments | ||
- name: range | ||
- name: receiver-naming | ||
- name: time-naming | ||
- name: unexported-return | ||
- name: indent-error-flow | ||
- name: errorf | ||
- name: empty-block | ||
- name: superfluous-else | ||
- name: struct-tag | ||
- name: unreachable-code | ||
- name: redefines-builtin-id | ||
exclusions: | ||
generated: lax | ||
presets: | ||
- comments | ||
- common-false-positives | ||
- legacy | ||
- std-error-handling | ||
formatters: | ||
enable: | ||
- gofmt | ||
- goimports |
This file contains hidden or 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 hidden or 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,9 +9,10 @@ import ( | |
func Builder() *cobra.Command { | ||
o := &opts{fs: afero.NewOsFs()} | ||
cmd := &cobra.Command{ | ||
Use: "clusterToAdvancedCluster", | ||
Short: "Convert cluster to advanced_cluster preview provider 2.0.0", | ||
Long: "Convert a Terraform configuration from mongodbatlas_cluster to mongodbatlas_advanced_cluster preview provider 2.0.0", | ||
Use: "clusterToAdvancedCluster", | ||
Short: "Convert cluster to advanced_cluster preview provider 2.0.0", | ||
Long: "Convert a Terraform configuration from mongodbatlas_cluster to " + | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. keep line len under 120 chars |
||
"mongodbatlas_advanced_cluster preview provider 2.0.0", | ||
Aliases: []string{"clu2adv"}, | ||
RunE: func(_ *cobra.Command, _ []string) error { | ||
if err := o.PreRun(); err != nil { | ||
|
@@ -24,8 +25,11 @@ func Builder() *cobra.Command { | |
_ = cmd.MarkFlagRequired(flag.File) | ||
cmd.Flags().StringVarP(&o.output, flag.Output, flag.OutputShort, "", "output file") | ||
_ = cmd.MarkFlagRequired(flag.Output) | ||
cmd.Flags().BoolVarP(&o.replaceOutput, flag.ReplaceOutput, flag.ReplaceOutputShort, false, "replace output file if exists") | ||
cmd.Flags().BoolVarP(&o.watch, flag.Watch, flag.WatchShort, false, "keeps the plugin running and watches the input file for changes") | ||
cmd.Flags().BoolVarP(&o.includeMoved, flag.IncludeMoved, flag.IncludeMovedShort, false, "include moved blocks in the output file") | ||
cmd.Flags().BoolVarP(&o.replaceOutput, flag.ReplaceOutput, flag.ReplaceOutputShort, false, | ||
"replace output file if exists") | ||
cmd.Flags().BoolVarP(&o.watch, flag.Watch, flag.WatchShort, false, | ||
"keeps the plugin running and watches the input file for changes") | ||
cmd.Flags().BoolVarP(&o.includeMoved, flag.IncludeMoved, flag.IncludeMovedShort, false, | ||
"include moved blocks in the output file") | ||
return cmd | ||
} |
This file contains hidden or 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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice to use line-length 🎉