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

testifylint->useless-assert - Should we enable it? #15538

Open
zak-pawel opened this issue Jun 20, 2024 · 2 comments · May be fixed by #15566
Open

testifylint->useless-assert - Should we enable it? #15538

zak-pawel opened this issue Jun 20, 2024 · 2 comments · May be fixed by #15566
Labels

Comments

@zak-pawel
Copy link
Collaborator

Description

This issue starts a discussion about enabling:

  • linter: testifylint - Checks usage of github.com/stretchr/testify.
  • checker: useless-assert - Protection from bugs and possible dead code.

Example

Currently the checker guards against assertion of the same variable:

❌
assert.Equal(t, tt.value, tt.value)
assert.ElementsMatch(t, users, users)
// And so on...
assert.True(t, num > num)
assert.False(t, num == num)

Expected output

Decision about enabling or not enabling this checker.

Findings

For this checker, no findings were found in the current codebase.

Additional configuration

For this checker, no additional configuration can be provided.

@srebhan
Copy link
Contributor

srebhan commented Jun 24, 2024

Makes sense to me as the developer probably wanted to test something else. ;-)

@srebhan srebhan removed their assignment Jun 24, 2024
@powersj
Copy link
Contributor

powersj commented Jun 25, 2024

+1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
3 participants