linters: add httpstatus linter

This commit is contained in:
2026-10-18 15:02:44 -07:00
parent 7b5000b663
commit 9f10798be1
9 changed files with 315 additions and 0 deletions

View File

@@ -0,0 +1,22 @@
package httpstatus_test
import (
"testing"
"golang.org/x/tools/go/analysis/analysistest"
"git.offline-twitter.com/offline-labs/go-lint/pkg/httpstatus"
)
func TestAnalyzer(t *testing.T) {
analysistest.Run(t, analysistest.TestData(), httpstatus.Analyzer, "default")
}
func TestAnalyzerWithSettings(t *testing.T) {
analyzer := httpstatus.NewAnalyzer(httpstatus.Settings{
TypicalStatusCodes: []int{201},
IsRestricted: true,
})
analysistest.Run(t, analysistest.TestData(), analyzer, "configured")
}