From 3aea9c00f55d83e80cb054ce3093af28ddececf2 Mon Sep 17 00:00:00 2001 From: Masayuki Morita Date: Fri, 2 Aug 2024 23:02:16 +0900 Subject: [PATCH 1/2] Update golangci-lint to v1.59.1 --- .github/workflows/lint.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/lint.yaml b/.github/workflows/lint.yaml index aa1ec87..0f3b9fb 100644 --- a/.github/workflows/lint.yaml +++ b/.github/workflows/lint.yaml @@ -20,6 +20,6 @@ jobs: with: go-version-file: '.go-version' - name: golangci-lint - uses: golangci/golangci-lint-action@v3 + uses: golangci/golangci-lint-action@v6 with: - version: v1.54.2 + version: v1.59.1 From 592dd08ad3b8bbd1252794d0f4e25dd6caf67346 Mon Sep 17 00:00:00 2001 From: Masayuki Morita Date: Fri, 2 Aug 2024 23:02:27 +0900 Subject: [PATCH 2/2] Fix lint issues --- cmd/attribute.go | 2 +- cmd/block.go | 2 +- cmd/body.go | 2 +- editor/operator_edit.go | 4 ++++ 4 files changed, 7 insertions(+), 3 deletions(-) diff --git a/cmd/attribute.go b/cmd/attribute.go index e5f2d17..91cf8f7 100644 --- a/cmd/attribute.go +++ b/cmd/attribute.go @@ -17,7 +17,7 @@ func newAttributeCmd() *cobra.Command { cmd := &cobra.Command{ Use: "attribute", Short: "Edit attribute", - RunE: func(cmd *cobra.Command, args []string) error { + RunE: func(cmd *cobra.Command, _ []string) error { return cmd.Help() }, } diff --git a/cmd/block.go b/cmd/block.go index e3b7213..1bab911 100644 --- a/cmd/block.go +++ b/cmd/block.go @@ -17,7 +17,7 @@ func newBlockCmd() *cobra.Command { cmd := &cobra.Command{ Use: "block", Short: "Edit block", - RunE: func(cmd *cobra.Command, args []string) error { + RunE: func(cmd *cobra.Command, _ []string) error { return cmd.Help() }, } diff --git a/cmd/body.go b/cmd/body.go index b39ab3e..0844d90 100644 --- a/cmd/body.go +++ b/cmd/body.go @@ -16,7 +16,7 @@ func newBodyCmd() *cobra.Command { cmd := &cobra.Command{ Use: "body", Short: "Edit body", - RunE: func(cmd *cobra.Command, args []string) error { + RunE: func(cmd *cobra.Command, _ []string) error { return cmd.Help() }, } diff --git a/editor/operator_edit.go b/editor/operator_edit.go index 809dbf2..ba53849 100644 --- a/editor/operator_edit.go +++ b/editor/operator_edit.go @@ -92,6 +92,10 @@ func UpdateFile(filename string, filter Filter) error { } // Write contents back to source file if changed. + // nolint gosec + // G306: Expect WriteFile permissions to be 0600 or less + // We ignore it because the update operation does not affect file + // permissions. if err = os.WriteFile(filename, output, os.ModePerm); err != nil { return fmt.Errorf("failed to write file: %s", err) }