From 600606405cc42405adedc8cc15acd2a3902fb612 Mon Sep 17 00:00:00 2001 From: Mateus Oliveira Date: Mon, 27 May 2024 13:46:36 -0300 Subject: [PATCH] fix: enforce comment spaces Signed-off-by: Mateus Oliveira --- .golangci.yml | 1 + .../src/cronjob-tutorial/testdata/project/.golangci.yml | 6 ++++++ .../book/src/getting-started/testdata/project/.golangci.yml | 6 ++++++ pkg/cli/alpha.go | 2 +- .../golang/v4/scaffolds/internal/templates/golangci.go | 6 ++++++ pkg/rescaffold/migrate.go | 2 +- .../project-v4-multigroup-with-deploy-image/.golangci.yml | 6 ++++++ testdata/project-v4-multigroup/.golangci.yml | 6 ++++++ testdata/project-v4-with-deploy-image/.golangci.yml | 6 ++++++ testdata/project-v4-with-grafana/.golangci.yml | 6 ++++++ testdata/project-v4/.golangci.yml | 6 ++++++ 11 files changed, 51 insertions(+), 2 deletions(-) diff --git a/.golangci.yml b/.golangci.yml index e78943727d..20a502ddce 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -61,6 +61,7 @@ linters-settings: # - name: bool-literal-in-expr - name: constant-logical-expr + - name: comment-spacings linters: disable-all: true diff --git a/docs/book/src/cronjob-tutorial/testdata/project/.golangci.yml b/docs/book/src/cronjob-tutorial/testdata/project/.golangci.yml index 709ef192a1..aac8a13f92 100644 --- a/docs/book/src/cronjob-tutorial/testdata/project/.golangci.yml +++ b/docs/book/src/cronjob-tutorial/testdata/project/.golangci.yml @@ -34,8 +34,14 @@ linters: - misspell - nakedret - prealloc + - revive - staticcheck - typecheck - unconvert - unparam - unused + +linters-settings: + revive: + rules: + - name: comment-spacings diff --git a/docs/book/src/getting-started/testdata/project/.golangci.yml b/docs/book/src/getting-started/testdata/project/.golangci.yml index 709ef192a1..aac8a13f92 100644 --- a/docs/book/src/getting-started/testdata/project/.golangci.yml +++ b/docs/book/src/getting-started/testdata/project/.golangci.yml @@ -34,8 +34,14 @@ linters: - misspell - nakedret - prealloc + - revive - staticcheck - typecheck - unconvert - unparam - unused + +linters-settings: + revive: + rules: + - name: comment-spacings diff --git a/pkg/cli/alpha.go b/pkg/cli/alpha.go index 65147e4852..ab392e323d 100644 --- a/pkg/cli/alpha.go +++ b/pkg/cli/alpha.go @@ -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 } diff --git a/pkg/plugins/golang/v4/scaffolds/internal/templates/golangci.go b/pkg/plugins/golang/v4/scaffolds/internal/templates/golangci.go index 88adb2cc16..f4376036ae 100644 --- a/pkg/plugins/golang/v4/scaffolds/internal/templates/golangci.go +++ b/pkg/plugins/golang/v4/scaffolds/internal/templates/golangci.go @@ -78,9 +78,15 @@ linters: - misspell - nakedret - prealloc + - revive - staticcheck - typecheck - unconvert - unparam - unused + +linters-settings: + revive: + rules: + - name: comment-spacings ` diff --git a/pkg/rescaffold/migrate.go b/pkg/rescaffold/migrate.go index f277bced5d..b739ea8da9 100644 --- a/pkg/rescaffold/migrate.go +++ b/pkg/rescaffold/migrate.go @@ -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) } diff --git a/testdata/project-v4-multigroup-with-deploy-image/.golangci.yml b/testdata/project-v4-multigroup-with-deploy-image/.golangci.yml index 709ef192a1..aac8a13f92 100644 --- a/testdata/project-v4-multigroup-with-deploy-image/.golangci.yml +++ b/testdata/project-v4-multigroup-with-deploy-image/.golangci.yml @@ -34,8 +34,14 @@ linters: - misspell - nakedret - prealloc + - revive - staticcheck - typecheck - unconvert - unparam - unused + +linters-settings: + revive: + rules: + - name: comment-spacings diff --git a/testdata/project-v4-multigroup/.golangci.yml b/testdata/project-v4-multigroup/.golangci.yml index 709ef192a1..aac8a13f92 100644 --- a/testdata/project-v4-multigroup/.golangci.yml +++ b/testdata/project-v4-multigroup/.golangci.yml @@ -34,8 +34,14 @@ linters: - misspell - nakedret - prealloc + - revive - staticcheck - typecheck - unconvert - unparam - unused + +linters-settings: + revive: + rules: + - name: comment-spacings diff --git a/testdata/project-v4-with-deploy-image/.golangci.yml b/testdata/project-v4-with-deploy-image/.golangci.yml index 709ef192a1..aac8a13f92 100644 --- a/testdata/project-v4-with-deploy-image/.golangci.yml +++ b/testdata/project-v4-with-deploy-image/.golangci.yml @@ -34,8 +34,14 @@ linters: - misspell - nakedret - prealloc + - revive - staticcheck - typecheck - unconvert - unparam - unused + +linters-settings: + revive: + rules: + - name: comment-spacings diff --git a/testdata/project-v4-with-grafana/.golangci.yml b/testdata/project-v4-with-grafana/.golangci.yml index 709ef192a1..aac8a13f92 100644 --- a/testdata/project-v4-with-grafana/.golangci.yml +++ b/testdata/project-v4-with-grafana/.golangci.yml @@ -34,8 +34,14 @@ linters: - misspell - nakedret - prealloc + - revive - staticcheck - typecheck - unconvert - unparam - unused + +linters-settings: + revive: + rules: + - name: comment-spacings diff --git a/testdata/project-v4/.golangci.yml b/testdata/project-v4/.golangci.yml index 709ef192a1..aac8a13f92 100644 --- a/testdata/project-v4/.golangci.yml +++ b/testdata/project-v4/.golangci.yml @@ -34,8 +34,14 @@ linters: - misspell - nakedret - prealloc + - revive - staticcheck - typecheck - unconvert - unparam - unused + +linters-settings: + revive: + rules: + - name: comment-spacings