Skip to content

Commit

Permalink
chore: fix lint violations
Browse files Browse the repository at this point in the history
  • Loading branch information
ekristen committed Oct 19, 2024
1 parent e8aaa49 commit 6297aa5
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 9 deletions.
13 changes: 7 additions & 6 deletions pkg/commands/docs/docs.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@ import (
"bytes"
"embed"
"fmt"
"golang.org/x/text/cases"
"golang.org/x/text/language"
"html/template"
"os"
"path/filepath"
Expand All @@ -15,6 +13,9 @@ import (

"github.com/urfave/cli/v2"

"golang.org/x/text/cases"
"golang.org/x/text/language"

"github.com/ekristen/libnuke/pkg/docs"
"github.com/ekristen/libnuke/pkg/registry"

Expand All @@ -37,7 +38,7 @@ type TemplateData struct {
AlternativeResource string
}

func execute(c *cli.Context) error {
func execute(c *cli.Context) error { //nolint:funlen,gocyclo
var regs registry.Registrations

if c.String("resource") == "all" {
Expand Down Expand Up @@ -88,7 +89,7 @@ func execute(c *cli.Context) error {
if c.Bool("write-to-disk") {
err := os.WriteFile(
fmt.Sprintf("docs/resources/%s.md",
KebabCase(strings.ToLower(SplitCamelCase(reg.Name)))), buf.Bytes(), 0644)
KebabCase(strings.ToLower(SplitCamelCase(reg.Name)))), buf.Bytes(), 0600)
if err != nil {
return err
}
Expand Down Expand Up @@ -143,7 +144,7 @@ func execute(c *cli.Context) error {
newMkdocs := updateResources(string(mkdocs), newResources)

if c.Bool("write-to-disk") {
err := os.WriteFile("mkdocs.yml", []byte(newMkdocs), 0644)
err := os.WriteFile("mkdocs.yml", []byte(newMkdocs), 0600)
if err != nil {
return err
}
Expand Down Expand Up @@ -210,7 +211,7 @@ func toLower(in string) string {
func SplitCamelCase(input string) string {
// Regular expression to find boundaries between lowercase and uppercase letters,
// and between sequences of uppercase letters followed by lowercase letters.
re := regexp.MustCompile(`([a-z])([A-Z0-9])|([A-Z]+)([A-Z][a-z])|([0-9])([A-Z])`)
re := regexp.MustCompile(`([a-z])([A-Z0-9])|([A-Z]+)([A-Z][a-z])|(\d)([A-Z])`)
// Replace boundaries with a space followed by the uppercase letter.
return re.ReplaceAllString(input, "${1}${3}${5} ${2}${4}${6}")
}
Expand Down
2 changes: 1 addition & 1 deletion resources/acm-pca-certificate-authority-state.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ func (l *ACMPCACertificateAuthorityStateLister) List(_ context.Context, o interf
type ACMPCACertificateAuthorityState struct {
svc *acmpca.ACMPCA
ARN *string `description:"The Amazon Resource Name (ARN) that was assigned to the CA when it was created."`
Status *string `description:"The status of the CA, indicating whether it is active, creating, pending_certificate, disabled, or deleted."`
Status *string `description:"The status of the CA, indicating whether it is active, creating, pending_certificate, disabled, or deleted."` //nolint:lll
Tags []*acmpca.Tag `description:"Tags associated with the CA."`
}

Expand Down
6 changes: 4 additions & 2 deletions resources/acm-pca-certificate-authority_mock_test.go
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
package resources

import (
"github.com/aws/aws-sdk-go/service/acmpca"
"testing"

"github.com/gotidy/ptr"
"github.com/stretchr/testify/assert"
"testing"

"github.com/aws/aws-sdk-go/service/acmpca"
)

func Test_Mock_ACMPCACertificateAuthority_Properties(t *testing.T) {
Expand Down

0 comments on commit 6297aa5

Please sign in to comment.