feat: new checkers http-method and http-status-code#291
Conversation
ccoVeille
left a comment
There was a problem hiding this comment.
👍
But I would have separated http.Status* and http.Method*
I remember a discussion where @alexandear was involved in go github where people where disliking the http.Method*, but where OK for http.Status* one
Do you remember the context @alexandear ?
From Brad Fitzpatrick perkeep/perkeep#1649 (comment):
|
|
Notice that the AddImports method here is reused in several other PR. This version shall be used by them as it is the most evolved version yet . |
Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>
@mmorel-35 what are your thoughts about this https://github.com/sashamelentyev/usestdlibvars has 2 rules for this |
Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>
|
I believe it's better to be aligned with what other linters are already doing so in that case, let's split this in two checkers |
http-consthttp-method and http-status-code
Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>
aa605fc to
ea03bf8
Compare
…sutil/file.go Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>
Remove http-const section from CONTRIBUTING.md
Splits the
http-constchecker into two focused checkers aligned withusestdlibvarsnaming conventions. No backwards compatibility required.New checkers
http-method— flags HTTP method string literals in all testify HTTP assertions (HTTPStatusCode,HTTPBody*,HTTPError,HTTPRedirect,HTTPSuccess)http-status-code— flags HTTP status code integer literals inHTTPStatusCodeChanges
http_const.goandgen_http_const.go; replaced withhttp_method.go,http_status_code.goand corresponding testgen filesnewHTTPMethodTextEdit,newHTTPStatusCodeTextEdit,httpQualifiedName) intohelpers_http.gohttp-method-no-import/http-status-code-no-importtest cases (auto-import fix coverage)Covers #155
Closes #141