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

Fix issues reported by testifylint #4116

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

deining
Copy link

@deining deining commented Dec 13, 2024

This PR fixes a few issues reported from testifylint.

@@ -998,7 +998,7 @@ func TestContextRenderIndentedJSON(t *testing.T) {
c.IndentedJSON(http.StatusCreated, H{"foo": "bar", "bar": "foo", "nested": H{"foo": "bar"}})

assert.Equal(t, http.StatusCreated, w.Code)
assert.Equal(t, "{\n \"bar\": \"foo\",\n \"foo\": \"bar\",\n \"nested\": {\n \"foo\": \"bar\"\n }\n}", w.Body.String())
assert.JSONEq(t, "{\n \"bar\": \"foo\",\n \"foo\": \"bar\",\n \"nested\": {\n \"foo\": \"bar\"\n }\n}", w.Body.String())

Choose a reason for hiding this comment

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

This regresses the test. JSONEq will ignore the formatting but this test asserts that the body is indented JSON.

Choose a reason for hiding this comment

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

Which testifylint rule was this? And with which version of testifylint?

I'd like to raise this an issue on the linter but I can't replicate the behaviour.

Copy link
Author

@deining deining Dec 18, 2024

Choose a reason for hiding this comment

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

Which testifylint rule was this? And with which version of testifylint?

testifylint -V=full
/usr/local/bin/testifylint version devel comments-go-here buildID=b4feaeeee0471267f317aa4baaca3111987511befe6032bbd9b54f9f7a9f0923

Please note that the switch -V of testifylint is broken, there exists an issue for that already.

I'd like to raise this an issue on the linter but I can't replicate the behaviour.

Please have a look at this workflow run which clearly shows the problem.

@deining deining closed this Dec 18, 2024
@deining deining deleted the testifylint branch December 18, 2024 20:35
@deining deining reopened this Dec 18, 2024
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.

2 participants