Skip to content
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

core: fix remaining golangci-lint issues #10972

Merged
merged 1 commit into from
Oct 22, 2023
Merged

Conversation

jmank88
Copy link
Contributor

@jmank88 jmank88 commented Oct 16, 2023

This PR cleans up the last of the remaining linter issues.

@github-actions
Copy link
Contributor

I see that you haven't updated any CHANGELOG files. Would it make sense to do so?

@jmank88 jmank88 force-pushed the golangci-lint-2023-10-16 branch from 2a94340 to 70b02c1 Compare October 16, 2023 20:02
@@ -525,6 +525,8 @@ func NewJobResource(j job.Job) *JobResource {
resource.BootstrapSpec = NewBootstrapSpec(j.BootstrapSpec)
case job.Gateway:
resource.GatewaySpec = NewGatewaySpec(j.GatewaySpec)
case job.LegacyGasStationServer, job.LegacyGasStationSidecar:
// unsupported
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this OK? Or an oversight to correct?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removing this should be OK, functionality is equivalent right?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah this change aims to be equivalent while satisfying the linter.

But was it an oversight that support was not added in the first place? Should we create a ticket?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it was intentional that it's unsupported. cc @jinhoonbang

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jinhoonbang is an owner of this GasStation I believe ;)

@@ -304,7 +305,7 @@ func TestLegacyMode(t *testing.T) {
require.Equal(t, true, tm.legacyMode)
require.Len(t, tm.endpoints, 1)

clientSent := make([]synchronization.TelemPayload, 0)
var clientSent []synchronization.TelemPayload
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The linter understands the length check down below when we use the simpler declaration style 🤷

Comment on lines -65 to -68
type broadcasterHelperCfg struct {
highestSeenHead *evmtypes.Head
db *sqlx.DB
}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was awkward and barely used any longer, so I simplified it away. The db field was no cost, but the tradeoff for highestSeenHead is to pass some nils instead 🤷

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i don't love required args with nil values, but the surface is small and only in tests so maybe ok.

l like XXXcfg.New() (*XXX) even less...

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah I thought the same but didn't stress since it's not even exported

@jmank88 jmank88 marked this pull request as ready for review October 16, 2023 20:07
@jmank88 jmank88 requested a review from a team October 16, 2023 20:07
@jmank88 jmank88 force-pushed the golangci-lint-2023-10-16 branch from 70b02c1 to bc8ae73 Compare October 16, 2023 20:32
krehermann
krehermann previously approved these changes Oct 16, 2023
@jmank88 jmank88 enabled auto-merge October 16, 2023 21:48
@jmank88
Copy link
Contributor Author

jmank88 commented Oct 17, 2023

Currently debugging one test, and a rebase flagged ~60 new issues 🤦

cc @chainchad it seems like the PR linter is still broken/out-of-sync with overnight & local runs.

@jmank88 jmank88 force-pushed the golangci-lint-2023-10-16 branch 3 times, most recently from fa4aa5f to de438d9 Compare October 20, 2023 01:08
@jmank88 jmank88 requested a review from a team as a code owner October 20, 2023 01:08
@jmank88 jmank88 force-pushed the golangci-lint-2023-10-16 branch 4 times, most recently from a811e2d to eeb30cb Compare October 21, 2023 15:46
@jmank88 jmank88 requested a review from krehermann October 21, 2023 23:12
@jmank88 jmank88 force-pushed the golangci-lint-2023-10-16 branch from eeb30cb to dbe0f0c Compare October 21, 2023 23:26
@cl-sonarqube-production
Copy link

SonarQube Quality Gate

Quality Gate failed

Failed condition 66.7% 66.7% Coverage on New Code (is less than 75%)

See analysis details on SonarQube

@jmank88 jmank88 added this pull request to the merge queue Oct 22, 2023
Merged via the queue into develop with commit 35057f1 Oct 22, 2023
92 of 93 checks passed
@jmank88 jmank88 deleted the golangci-lint-2023-10-16 branch October 22, 2023 13:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants