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

Add static analysis #35

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

austinvazquez
Copy link
Contributor

@austinvazquez austinvazquez commented Oct 12, 2024

Issue

Partial #34

Description

This change refactors unit tests to resolve lint warnings and adds static analysis to CI.

b.Add(sinks[i])
b.Add(sinks[i]) // noop
err := b.Add(sinks[i])
assert.NoError(t, err)
Copy link
Member

Choose a reason for hiding this comment

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

Wondering if we (haven't looked closely yet) can do without assertion library). The repo had only one dependency (logrus) which we probably may be able to get rid of; in that case it would have no dependencies at all, which is rather nice

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Should not be too bad without the library. All the assertions are NoError on second review.

Copy link
Member

Choose a reason for hiding this comment

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

Yes, if it's indeed only those (and no advanced assertions are needed), that'd be great.

It's slightly more cumbersome to write, but may be worth the effort for library modules like this. 🤗

queue_test.go Outdated
"testing"
"time"

"golang.org/x/sync/errgroup"
Copy link
Member

Choose a reason for hiding this comment

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

Oh, right; if we must have to use this one, then I guess we'd not be able to have zero-dependencies.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Maybe I can take a second try at this. Was only working to appease the linter. Might not be worth pulling in a dependency just for that.

@austinvazquez
Copy link
Contributor Author

Ran CI in fork. See austinvazquez#2

@austinvazquez austinvazquez force-pushed the add-static-analysis branch 2 times, most recently from ba68a5c to ea41a33 Compare October 18, 2024 01:43
@austinvazquez austinvazquez marked this pull request as ready for review October 18, 2024 01:44
Signed-off-by: Austin Vazquez <[email protected]>
Signed-off-by: Austin Vazquez <[email protected]>
Copy link
Member

@thaJeztah thaJeztah left a comment

Choose a reason for hiding this comment

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

LGTM

@thaJeztah
Copy link
Member

@vvoland LGTY?

Copy link

@vvoland vvoland left a comment

Choose a reason for hiding this comment

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

Left one comment, but overall LGTM

- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: "oldstable"
Copy link

Choose a reason for hiding this comment

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

Perhaps use an explicit version here?

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.

3 participants