-
Notifications
You must be signed in to change notification settings - Fork 191
chore: Remove unneeded Go linter exceptions #3247
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
@@ -161,7 +161,7 @@ func TestAccMockableAdvancedCluster_tenantUpgrade(t *testing.T) { | |||
projectID, clusterName = acc.ProjectIDExecutionWithCluster(t, 1) | |||
defaultZoneName = "Zone 1" // Uses backend default to avoid non-empty plan, see CLOUDP-294339 | |||
) | |||
unit.CaptureOrMockTestCaseAndRun(t, mockConfig, &resource.TestCase{ | |||
unit.CaptureOrMockTestCaseAndRun(t, &mockConfig, &resource.TestCase{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixes: hugeParam: config is heavy (112 bytes); consider passing it by pointer (gocritic)
customOpensslCipherConfigTLS12Str = fmt.Sprintf( | ||
`custom_openssl_cipher_config_tls12 = ["%s"]`, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixes: sprintfQuotedString: use %q instead of "%s" for quoted strings (gocritic)
@@ -1,4 +1,3 @@ | |||
//nolint:gocritic |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
leftover, no needed anymore
@@ -1,4 +1,3 @@ | |||
//nolint:gocritic |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
leftover, no needed anymore
@@ -30,12 +30,6 @@ type MockHTTPDataConfig struct { | |||
IsDiffMustSubstrings []string // Only include diff request for specific substrings, for example /clusters (avoids project create requests) | |||
QueryVars []string // Substitute this query vars. Useful when differentiating responses based on query args, for example ?providerName=AWS/AZURE returns different responses | |||
AllowMissingRequests bool // When false will require all API calls to be made. | |||
AllowOutOfOrder bool // When true will allow a GET request returned after a POST to be returned before the POST. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think AllowOutOfOrder is not being used anymore, can @EspenAlbert you please confirm?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Although not used anywhere in the code, it can be helpful while debugging. I would prefer to keep it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok, keeping, adding comment
@@ -53,7 +47,7 @@ func IsDataUpdate() bool { | |||
return val | |||
} | |||
|
|||
func CaptureOrMockTestCaseAndRun(t *testing.T, config MockHTTPDataConfig, testCase *resource.TestCase) { //nolint: gocritic // Want each test run to have its own config (hugeParam: config is heavy (112 bytes); consider passing it by pointer) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixes: hugeParam: config is heavy (112 bytes); consider passing it by pointer (gocritic)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Want each test run to have its own config
I prefer keeping this as is
@@ -56,7 +56,7 @@ type RequestInfo struct { | |||
} | |||
|
|||
// Custom marshaling is necessary to use `flow` style only on response fields (text and responses.*.text) | |||
func (i RequestInfo) MarshalYAML() (any, error) { //nolint:gocritic // Using a pointer method leads to inconsistent dump results | |||
func (i *RequestInfo) MarshalYAML() (any, error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixes: hugeParam: i is heavy (88 bytes); consider passing it by pointer (gocritic)
al other RequestInfo funcs are using pointers
Version string `yaml:"version"` | ||
Text string `yaml:"text"` | ||
Responses []StatusText `yaml:"responses"` | ||
Responses *[]StatusText `yaml:"responses"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixes: hugeParam: i is heavy (88 bytes); consider passing it by pointer (gocritic)
@@ -53,7 +47,7 @@ func IsDataUpdate() bool { | |||
return val | |||
} | |||
|
|||
func CaptureOrMockTestCaseAndRun(t *testing.T, config MockHTTPDataConfig, testCase *resource.TestCase) { //nolint: gocritic // Want each test run to have its own config (hugeParam: config is heavy (112 bytes); consider passing it by pointer) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we should double check with @EspenAlbert but it seems the pass by value is intentional and needed here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks, I'll wait
This reverts commit a2be534.
* master: chore: Updates org_clean_test.go to delete stream instances & private endpoint services (#3252) chore: Updates organization.md `skip_default_alerts_settings` note format (#3246) doc: Update guidelines for external contributors to squash commits (#3243) chore: Updates CHANGELOG.md for #3199
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you!
encryption test group is also failing in master, e.g. here |
Description
Remove unneeded Go linter exceptions. Only do exceptions when strictly needed so the codebase follows linter rules.
CANNOT_DISABLE_ENCRYPTION_AT_REST_REQUIRE_PRIVATE_NETWORKING_WHILE_PRIVATE_ENDPOINTS_EXIST
Type of change:
Required Checklist:
Further comments