Skip to content

fail-now: suggest t.Fatalf instead of weird assertions #144

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

Open
Antonboom opened this issue Jun 21, 2024 · 3 comments
Open

fail-now: suggest t.Fatalf instead of weird assertions #144

Antonboom opened this issue Jun 21, 2024 · 3 comments
Labels
enhancement New feature or request new-checker

Comments

@Antonboom
Copy link
Owner

Need to find more cases like:

https://github.com/kubernetes/kubernetes/blob/5ec31e84d6c525c173906b1497ee6f075c1926e9/pkg/controller/podautoscaler/horizontal_test.go#L760

@Antonboom Antonboom added the enhancement New feature or request label Jun 21, 2024
@Antonboom Antonboom changed the title fail-now: suggest t.Fatalf instead of weird assertions fail-now: suggest t.Fatalf instead of weird assertions Jun 21, 2024
@mmorel-35
Copy link

Until now testifylint always suggest the use of testify require or assert . If the intention is to fail deliberately fail two options seems possible with the use of testify.

I'm not very familiar with their use but seems to be something to explore to address this issue.

@Antonboom
Copy link
Owner Author

+ *assert.CollectT.FailNow

@Antonboom
Copy link
Owner Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request new-checker
Projects
None yet
Development

No branches or pull requests

2 participants