Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion internal/apiclient/auth.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
go func() {
defer close(shutdown)

for {

Check failure on line 68 in internal/apiclient/auth.go

View workflow job for this annotation

GitHub Actions / Build

S1000: should use for range instead of for { select {} } (gosimple)
select {
case <-time.After(time.Minute * 5):
shutdown <- callbackServerResp{err: fmt.Errorf("timeout")}
Expand All @@ -76,7 +76,7 @@
}()

go func() {
_ = http.Serve(listener, http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
_ = http.Serve(listener, http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { // nolint: gosec
if r.Method == http.MethodOptions {
return
}
Expand Down
2 changes: 1 addition & 1 deletion internal/apiclient/usage.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ func NewUsageAPIClient(ctx *config.RunContext) *UsageAPIClient {
}

if ctx.Config.TLSInsecureSkipVerify != nil {
tlsConfig.InsecureSkipVerify = *ctx.Config.TLSInsecureSkipVerify
tlsConfig.InsecureSkipVerify = *ctx.Config.TLSInsecureSkipVerify // nolint: gosec
}

return &UsageAPIClient{
Expand Down
4 changes: 2 additions & 2 deletions internal/comment/github.go
Original file line number Diff line number Diff line change
Expand Up @@ -188,8 +188,8 @@ func (h *githubPRHandler) CallFindMatchingComments(ctx context.Context, tag stri
variables := map[string]interface{}{
"owner": githubv4.String(h.owner),
"repo": githubv4.String(h.repo),
"prNumber": githubv4.Int(h.prNumber),
"after": (*githubv4.String)(nil), // Null after argument to get first page.
"prNumber": githubv4.Int(h.prNumber), // nolint:gosec // ignore G115: integer overflow conversion int -> int32
"after": (*githubv4.String)(nil), // Null after argument to get first page.
}

// Get comments from all pages.
Expand Down
2 changes: 1 addition & 1 deletion internal/config/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ projects:
t.Run(tt.name, func(t *testing.T) {
c := Config{}
path := filepath.Join(tmp, fmt.Sprintf("conf-%d.yaml", i))
err := os.WriteFile(path, tt.contents, os.ModePerm)
err := os.WriteFile(path, tt.contents, os.ModePerm) // nolint: gosec
require.NoError(t, err)

// we need to remove INFRACOST_TERRAFORM_CLOUD_TOKEN value for these tests.
Expand Down
1 change: 1 addition & 0 deletions internal/hcl/funcs/crypto_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -678,6 +678,7 @@ func TestFileSHA512(t *testing.T) {
}
}

// nolint:gosec
const (
CipherBase64 = "eczGaDhXDbOFRZGhjx2etVzWbRqWDlmq0bvNt284JHVbwCgObiuyX9uV0LSAMY707IEgMkExJqXmsB4OWKxvB7epRB9G/3+F+pcrQpODlDuL9oDUAsa65zEpYF0Wbn7Oh7nrMQncyUPpyr9WUlALl0gRWytOA23S+y5joa4M34KFpawFgoqTu/2EEH4Xl1zo+0fy73fEto+nfkUY+meuyGZ1nUx/+DljP7ZqxHBFSlLODmtuTMdswUbHbXbWneW51D7Jm7xB8nSdiA2JQNK5+Sg5x8aNfgvFTt/m2w2+qpsyFa5Wjeu6fZmXSl840CA07aXbk9vN4I81WmJyblD/ZA=="
PrivateKey = `
Expand Down
4 changes: 2 additions & 2 deletions internal/hcl/parser_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -736,7 +736,7 @@
panic(err)
}
path := filepath.Join(dir, filename)
if err := os.WriteFile(path, []byte(contents), os.ModePerm); err != nil {
if err := os.WriteFile(path, []byte(contents), os.ModePerm); err != nil { // nolint: gosec
panic(err)
}
return path
Expand Down Expand Up @@ -764,11 +764,11 @@
}
}

if err := os.WriteFile(filepath.Join(rootPath, "main.tf"), []byte(contents), os.ModePerm); err != nil {
if err := os.WriteFile(filepath.Join(rootPath, "main.tf"), []byte(contents), os.ModePerm); err != nil { // nolint: gosec
panic(err)
}

if err := os.WriteFile(filepath.Join(modulePath, "main.tf"), []byte(moduleContents), os.ModePerm); err != nil {

Check failure on line 771 in internal/hcl/parser_test.go

View workflow job for this annotation

GitHub Actions / Build

G306: Expect WriteFile permissions to be 0600 or less (gosec)
panic(err)
}

Expand Down
2 changes: 1 addition & 1 deletion internal/output/format.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ type scaledInt64 struct {
// length of the fraction.
func decimalToScaledInt(d decimal.Decimal, minFracLen, maxFracLen int) *scaledInt64 {
// round excess fraction part
d = d.Round(int32(maxFracLen))
d = d.Round(int32(maxFracLen)) // nolint:gosec

co := d.Coefficient().Int64()
ex := int(d.Exponent())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,10 @@ resource "ibm_is_ssh_key" "ssh_key" {
}

resource "ibm_is_instance" "vsi" {
for_each = toset(local.profiles)
name = "vsi-instance-${random_string.unique_identifier.result}-${each.key}"
image = data.ibm_is_image.redhat.id
keys = [ibm_is_ssh_key.ssh_key.id]
for_each = toset(local.profiles)
name = "vsi-instance-${random_string.unique_identifier.result}-${each.key}"
image = data.ibm_is_image.redhat.id
keys = [ibm_is_ssh_key.ssh_key.id]
profile = each.key
resource_group = ibm_resource_group.resource_group.id
vpc = ibm_is_vpc.vpc.id
Expand All @@ -80,10 +80,10 @@ resource "ibm_is_instance" "vsi" {
}

resource "ibm_is_instance" "vsi_boot_volume" {
for_each = toset(local.profiles)
name = "vsi-instance-boot-volume-${random_string.unique_identifier.result}-${each.key}"
image = data.ibm_is_image.windowssql.id
keys = [ibm_is_ssh_key.ssh_key.id]
for_each = toset(local.profiles)
name = "vsi-instance-boot-volume-${random_string.unique_identifier.result}-${each.key}"
image = data.ibm_is_image.windowssql.id
keys = [ibm_is_ssh_key.ssh_key.id]
profile = each.key
resource_group = ibm_resource_group.resource_group.id
vpc = ibm_is_vpc.vpc.id
Expand All @@ -102,10 +102,10 @@ resource "ibm_is_instance" "vsi_boot_volume" {
}

resource "ibm_is_instance" "vsi_dedicated_host" {
for_each = toset(local.profiles)
name = "vsi-instance-dedicated-host-${random_string.unique_identifier.result}-${each.key}"
image = data.ibm_is_image.sles.id
keys = [ibm_is_ssh_key.ssh_key.id]
for_each = toset(local.profiles)
name = "vsi-instance-dedicated-host-${random_string.unique_identifier.result}-${each.key}"
image = data.ibm_is_image.sles.id
keys = [ibm_is_ssh_key.ssh_key.id]
profile = each.key
resource_group = ibm_resource_group.resource_group.id
vpc = ibm_is_vpc.vpc.id
Expand Down
Loading