forked from TrueCloudLab/lego
chore: update linter (#1379)
This commit is contained in:
parent
83c626d9a1
commit
ae7daa7d33
5 changed files with 28 additions and 22 deletions
4
.github/workflows/main.yml
vendored
4
.github/workflows/main.yml
vendored
|
@ -15,9 +15,9 @@ jobs:
|
|||
runs-on: ubuntu-latest
|
||||
env:
|
||||
GO_VERSION: 1.16
|
||||
GOLANGCI_LINT_VERSION: v1.38.0
|
||||
GOLANGCI_LINT_VERSION: v1.39.0
|
||||
HUGO_VERSION: 0.54.0
|
||||
SEIHON_VERSION: v0.5.1
|
||||
SEIHON_VERSION: v0.8.3
|
||||
CGO_ENABLED: 0
|
||||
LEGO_E2E_TESTS: CI
|
||||
MEMCACHED_HOSTS: localhost:11211
|
||||
|
|
|
@ -46,29 +46,28 @@
|
|||
disable = [
|
||||
"interfacer", # deprecated
|
||||
"maligned", # deprecated
|
||||
"scopelint", # deprecated
|
||||
"cyclop", # duplicate of gocyclo
|
||||
"lll",
|
||||
"gas",
|
||||
"dupl",
|
||||
"prealloc",
|
||||
"scopelint",
|
||||
"bodyclose",
|
||||
"wsl",
|
||||
"stylecheck",
|
||||
"gosec",
|
||||
"dupl", # not relevant
|
||||
"prealloc", # too many false-positive
|
||||
"bodyclose", # too many false-positive
|
||||
"gomnd",
|
||||
"testpackage", # not relevant
|
||||
"nestif", # too many false-positive
|
||||
"goerr113", # not relevant
|
||||
"noctx",
|
||||
"nlreturn", # not relevant
|
||||
"wrapcheck",
|
||||
"tparallel", # not relevant
|
||||
"paralleltest", # not relevant
|
||||
"exhaustivestruct", # too many false-positive
|
||||
"nestif", # too many false-positive
|
||||
"wrapcheck",
|
||||
"goerr113", # not relevant
|
||||
"nlreturn", # not relevant
|
||||
"wsl", # not relevant
|
||||
"exhaustive", # not relevant
|
||||
"exhaustivestruct", # not relevant
|
||||
"makezero", # not relevant
|
||||
"forbidigo", # not relevant
|
||||
"ifshort", # not relevant
|
||||
"cyclop", # duplicate of gocyclo
|
||||
"wastedassign", # false-positive https://github.com/sanposhiho/wastedassign/issues/21
|
||||
"forbidigo", # not relevant
|
||||
"noctx",
|
||||
"forcetypeassert",
|
||||
]
|
||||
|
||||
|
@ -79,6 +78,7 @@
|
|||
exclude = [
|
||||
"Error return value of .((os\\.)?std(out|err)\\..*|.*Close|.*Flush|os\\.Remove(All)?|.*printf?|os\\.(Un)?Setenv). is not checked",
|
||||
"exported (type|method|function) (.+) should have comment or be unexported",
|
||||
"ST1000: at least one file in a package should have a package comment"
|
||||
]
|
||||
[[issues.exclude-rules]]
|
||||
path = "(.+)_test.go"
|
||||
|
|
|
@ -75,7 +75,7 @@ type Record struct {
|
|||
ParentID int `json:"parentId,omitempty"`
|
||||
Parent string `json:"parent,omitempty"`
|
||||
Source string `json:"source,omitempty"`
|
||||
ModifiedTs int64 `json:"modifiedTs,omitempty"`
|
||||
ModifiedTS int64 `json:"modifiedTs,omitempty"`
|
||||
Value []RecordValue `json:"value,omitempty"`
|
||||
RoundRobin []RecordValue `json:"roundRobin,omitempty"`
|
||||
}
|
||||
|
|
|
@ -122,7 +122,7 @@ func TestTxtRecordService_Get(t *testing.T) {
|
|||
ParentID: 273302,
|
||||
Parent: "domain",
|
||||
Source: "Domain",
|
||||
ModifiedTs: 1580908547863,
|
||||
ModifiedTS: 1580908547863,
|
||||
Value: []RecordValue{{
|
||||
Value: `"test"`,
|
||||
}},
|
||||
|
|
|
@ -149,8 +149,14 @@ func (m *DNSServerMock) HandleListRecordsetsSuccessfully() {
|
|||
|
||||
body, err := ioutil.ReadAll(r.Body)
|
||||
assert.Nil(m.t, err)
|
||||
exceptedString := "{\"name\":\"_acme-challenge.example.com.\",\"description\":\"Added TXT record for ACME dns-01 challenge using lego client\",\"type\":\"TXT\",\"ttl\":300,\"records\":[\"\\\"w6uP8Tcg6K2QR905Rms8iXTlksL6OD1KOWBxTK7wxPI\\\"\"]}"
|
||||
assert.Equal(m.t, string(body), exceptedString)
|
||||
exceptedString := `{
|
||||
"name": "_acme-challenge.example.com.",
|
||||
"description": "Added TXT record for ACME dns-01 challenge using lego client",
|
||||
"type": "TXT",
|
||||
"ttl": 300,
|
||||
"records": ["\"w6uP8Tcg6K2QR905Rms8iXTlksL6OD1KOWBxTK7wxPI\""]
|
||||
}`
|
||||
assert.JSONEq(m.t, string(body), exceptedString)
|
||||
fmt.Fprintf(w, `{
|
||||
"recordsets":[{
|
||||
"id":"321321"
|
||||
|
|
Loading…
Reference in a new issue