Skip to content

Commit

Permalink
fix(typing): fixing consistent use of the special aws boolean for new…
Browse files Browse the repository at this point in the history
… versions
  • Loading branch information
stvnksslr committed Jan 21, 2024
1 parent 6ed0d0b commit 390a128
Show file tree
Hide file tree
Showing 12 changed files with 16 additions and 14 deletions.
2 changes: 1 addition & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ var (
defaultLogLevel = "error"
)

// nolint
//nolint
func main() {
ctx := kong.Parse(&CLI)

Expand Down
4 changes: 2 additions & 2 deletions pkg/porcelain.go
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ func (p *Porcelain) PrintEntries(entries []core.EnvEntry) {

for i := range entries {
v := entries[i]
ep := ellipsis.Shorten(v.ResolvedPath, 30) // nolint: gomnd
ep := ellipsis.Shorten(v.ResolvedPath, 30) //nolint: gomnd
if !v.IsFound {
fmt.Fprintf(&buf, "[%s %s %s] %s\n", yellow(v.ProviderName), gray(ep), red("missing"), green(v.Key))
} else {
Expand All @@ -123,7 +123,7 @@ func (p *Porcelain) PrintEntries(entries []core.EnvEntry) {
fmt.Fprint(p.Out, out)
}
func maskedValue(v string) string {
return fmt.Sprintf("%s*****", v[:int(math.Min(float64(len(v)), 2))]) // nolint: gomnd
return fmt.Sprintf("%s*****", v[:int(math.Min(float64(len(v)), 2))]) //nolint: gomnd
}

func (p *Porcelain) PrintMatches(matches []core.Match) {
Expand Down
2 changes: 1 addition & 1 deletion pkg/providers/aws_secretsmanager.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ var defaultDeletionRecoveryWindowInDays int64 = 7

const versionSplit = ","

// nolint
//nolint
func init() {
metaInfo := core.MetaInfo{
Name: "aws_secretsmanager",
Expand Down
5 changes: 3 additions & 2 deletions pkg/providers/aws_ssm.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ type AWSSSM struct {

const awsssmName = "aws_ssm"

// nolint
//nolint
func init() {
metaInfo := core.MetaInfo{
Description: "AWS SSM (aka paramstore)",
Expand Down Expand Up @@ -70,10 +70,11 @@ func NewAWSSSM(logger logging.Logger) (core.Provider, error) {
}

func (a *AWSSSM) Put(kp core.KeyPath, val string) error {

_, err := a.client.PutParameter(context.TODO(), &ssm.PutParameterInput{
Name: &kp.Path,
Value: &val,
Overwrite: true,
Overwrite: aws.Bool(true),
Type: types.ParameterTypeString,
})
if err != nil {
Expand Down
1 change: 1 addition & 0 deletions pkg/providers/aws_ssm_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ func TestAWSSSM(t *testing.T) {
client := mock_providers.NewMockAWSSSMClient(ctrl)
path := "settings/prod/billing-svc"
val := "shazam"

in := ssm.GetParameterInput{Name: &path, WithDecryption: aws.Bool(true)}
out := ssm.GetParameterOutput{
Parameter: &types.Parameter{
Expand Down
2 changes: 1 addition & 1 deletion pkg/providers/google_secretmanager.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ type GoogleSecretManager struct {

const GoogleSecretManagerName = "google_secretmanager"

// nolint
//nolint
func init() {
metaInfo := core.MetaInfo{
Description: "Google Secret Manager",
Expand Down
2 changes: 1 addition & 1 deletion pkg/providers/heroku.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ func (h *Heroku) GetMapping(p core.KeyPath) ([]core.EnvEntry, error) {
return entries, nil
}

func (h *Heroku) Get(p core.KeyPath) (*core.EnvEntry, error) { // nolint:dupl
func (h *Heroku) Get(p core.KeyPath) (*core.EnvEntry, error) { //nolint:dupl
secret, err := h.getSecret(p)
if err != nil {
return nil, err
Expand Down
2 changes: 1 addition & 1 deletion pkg/providers/keypass.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ type KeyPass struct {

const KeyPassName = "KeyPass"

// nolint
//nolint
func init() {
metaInfo := core.MetaInfo{
Description: "Keypass",
Expand Down
4 changes: 2 additions & 2 deletions pkg/providers/lastpass.go
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ func (l *LastPass) notesToMap(notes string) map[string]string {
results := map[string]string{}
scanner := bufio.NewScanner(strings.NewReader(notes))
for scanner.Scan() {
findings := strings.SplitN(scanner.Text(), ":", 2) // nolint: gomnd
findings := strings.SplitN(scanner.Text(), ":", 2) //nolint: gomnd
if len(findings) == findingNoteCount {
results[strings.TrimSpace(findings[0])] = strings.TrimSpace(findings[1])
}
Expand All @@ -161,7 +161,7 @@ func (l *LastPass) getNodeByKeyName(key, notes string) (string, error) {

scanner := bufio.NewScanner(strings.NewReader(notes))
for scanner.Scan() {
findings := strings.SplitN(scanner.Text(), ":", 2) // nolint: gomnd
findings := strings.SplitN(scanner.Text(), ":", 2) //nolint: gomnd
if len(findings) == findingNoteCount && findings[0] == key {
return strings.TrimSpace(findings[1]), nil
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/providers/process_env.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ func (a *ProcessEnv) GetMapping(p core.KeyPath) ([]core.EnvEntry, error) {

kvs := make(map[string]string)
for _, envs := range os.Environ() {
pair := strings.SplitN(envs, "=", 2) // nolint: gomnd
pair := strings.SplitN(envs, "=", 2) //nolint: gomnd
kvs[pair[0]] = pair[1]
}
var entries []core.EnvEntry
Expand Down
2 changes: 1 addition & 1 deletion pkg/providers/vercel.go
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ func (ve *Vercel) GetMapping(p core.KeyPath) ([]core.EnvEntry, error) {
return entries, nil
}

func (ve *Vercel) Get(p core.KeyPath) (*core.EnvEntry, error) { // nolint:dupl
func (ve *Vercel) Get(p core.KeyPath) (*core.EnvEntry, error) { //nolint:dupl
secret, err := ve.getSecret(p)
if err != nil {
return nil, err
Expand Down
2 changes: 1 addition & 1 deletion pkg/teller_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ func (im *InMemProvider) Meta() core.MetaInfo {
return core.MetaInfo{}
}

// nolint
//nolint
func init() {
inmemProviderMeta := core.MetaInfo{
Name: "inmem-provider",
Expand Down

0 comments on commit 390a128

Please sign in to comment.