Skip to content

Commit

Permalink
Merge pull request #3960 from mateusoliveira43/fix/enforce-comment-sp…
Browse files Browse the repository at this point in the history
…aces

✨ Add revive golangci linter with comment-spacings rule
  • Loading branch information
k8s-ci-robot committed May 27, 2024
2 parents 32bc517 + 6006064 commit 6d8b808
Show file tree
Hide file tree
Showing 11 changed files with 51 additions and 2 deletions.
1 change: 1 addition & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ linters-settings:
#
- name: bool-literal-in-expr
- name: constant-logical-expr
- name: comment-spacings

linters:
disable-all: true
Expand Down
6 changes: 6 additions & 0 deletions docs/book/src/cronjob-tutorial/testdata/project/.golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,14 @@ linters:
- misspell
- nakedret
- prealloc
- revive
- staticcheck
- typecheck
- unconvert
- unparam
- unused

linters-settings:
revive:
rules:
- name: comment-spacings
6 changes: 6 additions & 0 deletions docs/book/src/getting-started/testdata/project/.golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,14 @@ linters:
- misspell
- nakedret
- prealloc
- revive
- staticcheck
- typecheck
- unconvert
- unparam
- unused

linters-settings:
revive:
rules:
- name: comment-spacings
2 changes: 1 addition & 1 deletion pkg/cli/alpha.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ var alphaCommands = []*cobra.Command{

func newAlphaCommand() *cobra.Command {
cmd := &cobra.Command{
//TODO: If we need to create alpha commands please add a new file for each command
// TODO: If we need to create alpha commands please add a new file for each command
}
return cmd
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,15 @@ linters:
- misspell
- nakedret
- prealloc
- revive
- staticcheck
- typecheck
- unconvert
- unparam
- unused
linters-settings:
revive:
rules:
- name: comment-spacings
`
2 changes: 1 addition & 1 deletion pkg/rescaffold/migrate.go
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,7 @@ func copyFile(src, des string) error {
if err != nil {
return fmt.Errorf("Source file path: %s does not exist. %v", src, err)
}
//Copy all the contents to the desitination file
// Copy all the contents to the desitination file
// nolint:gosec
return os.WriteFile(des, bytesRead, 0755)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,14 @@ linters:
- misspell
- nakedret
- prealloc
- revive
- staticcheck
- typecheck
- unconvert
- unparam
- unused

linters-settings:
revive:
rules:
- name: comment-spacings
6 changes: 6 additions & 0 deletions testdata/project-v4-multigroup/.golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,14 @@ linters:
- misspell
- nakedret
- prealloc
- revive
- staticcheck
- typecheck
- unconvert
- unparam
- unused

linters-settings:
revive:
rules:
- name: comment-spacings
6 changes: 6 additions & 0 deletions testdata/project-v4-with-deploy-image/.golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,14 @@ linters:
- misspell
- nakedret
- prealloc
- revive
- staticcheck
- typecheck
- unconvert
- unparam
- unused

linters-settings:
revive:
rules:
- name: comment-spacings
6 changes: 6 additions & 0 deletions testdata/project-v4-with-grafana/.golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,14 @@ linters:
- misspell
- nakedret
- prealloc
- revive
- staticcheck
- typecheck
- unconvert
- unparam
- unused

linters-settings:
revive:
rules:
- name: comment-spacings
6 changes: 6 additions & 0 deletions testdata/project-v4/.golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,14 @@ linters:
- misspell
- nakedret
- prealloc
- revive
- staticcheck
- typecheck
- unconvert
- unparam
- unused

linters-settings:
revive:
rules:
- name: comment-spacings

0 comments on commit 6d8b808

Please sign in to comment.