Skip to content

ci: enable all rules for testifylint - #7025

Open
mmorel-35 wants to merge 5 commits into
moby:masterfrom
mmorel-35:testifylint
Open

ci: enable all rules for testifylint#7025
mmorel-35 wants to merge 5 commits into
moby:masterfrom
mmorel-35:testifylint

Conversation

@mmorel-35

@mmorel-35 mmorel-35 commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

This refactors and modernizes test assertions replacing older assertion patterns with more expressive and idiomatic ones from the testify library. It also updates linter configuration for improved code quality checks.

Test assertion improvements:

  • Replaced require.Equal(t, true, errors.Is(...)) with require.ErrorIs for clearer error assertion.

Linter configuration:

  • Updated .golangci.yml to enable all testifylint checks by default, removing the previous list of disabled checks. This ensures stricter and more consistent test code quality.

Comment thread cache/metadata/metadata_test.go Outdated
Comment thread cache/remotecache/v1/chains_test.go Outdated
Comment thread client/llb/fileop_test.go Outdated
@mmorel-35
mmorel-35 force-pushed the testifylint branch 6 times, most recently from 4b92870 to 162f9b6 Compare August 18, 2026 17:20
mmorel-35 added a commit to mmorel-35/buildkit that referenced this pull request Aug 18, 2026
Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>
@mmorel-35

Copy link
Copy Markdown
Contributor Author

@tonistiigi ,
I have revert len, empty and bool-compare rules as you asked and just focused on the rest of the used methods. This includes ErrorContains, EqualError use instead of err.Error() comparisons. require.Error has been drop for thoses cases as thoses are already checking for non nil errors

@mmorel-35
mmorel-35 force-pushed the testifylint branch 3 times, most recently from 1173967 to 32f23d9 Compare August 20, 2026 10:42
Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>
@mmorel-35
mmorel-35 force-pushed the testifylint branch 5 times, most recently from 818392a to f08cac7 Compare August 20, 2026 11:01
Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>
Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>
Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>
Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants