replace reviewdog fully by golangci-lint (#6139)

Signed-off-by: Ondřej Benkovský <ondrej.benkovsky@jamf.com>
This commit is contained in:
Ondřej Benkovský 2023-06-09 18:08:23 +02:00 committed by GitHub
parent 6d3db023fe
commit 8c489bd400
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
17 changed files with 125 additions and 146 deletions

View file

@ -1,25 +0,0 @@
name: Reviewdog
on:
pull_request:
branches:
- master
permissions: read-all
jobs:
gofmt:
name: Go Fmt
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8
- run: find . -not -path '*/\.git/*' -type f -name '*.go' -exec gofmt -s -w {} \+
- uses: reviewdog/action-suggester@8f83d27e749053b2029600995c115026a010408e
whitespace:
name: Whitespace
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8
- run: find . -not -path '*/\.git/*' -type f -not -name '*.go' -exec sed -i 's/[[:space:]]\{1,\}$//' {} \+
- uses: reviewdog/action-suggester@8f83d27e749053b2029600995c115026a010408e

View file

@ -9,3 +9,4 @@ linters:
- typecheck
- whitespace
- unused
- gofmt

View file

@ -25,9 +25,9 @@ autopath.Func. Note the searchpath must be ending with the empty string.
I.e:
func (m Plugins ) AutoPath(state request.Request) []string {
func (m Plugins ) AutoPath(state request.Request) []string {
return []string{"first", "second", "last", ""}
}
}
*/
package autopath

View file

@ -7,7 +7,6 @@ NXDOMAIN depending on the state of the cluster.
A plugin willing to provide these services must implement the Externaler interface, although it
likely only makes sense for the *kubernetes* plugin.
*/
package external

View file

@ -210,7 +210,7 @@ func (k *Kubernetes) ExternalServices(zone string, headless bool) (services []ms
return services, headlessServices
}
//ExternalSerial returns the serial of the external zone
// ExternalSerial returns the serial of the external zone
func (k *Kubernetes) ExternalSerial(string) uint32 {
return uint32(k.APIConn.Modified(true))
}

View file

@ -21,7 +21,7 @@ w1,example.org
`
var testOneDomainWRR = map[string]weights{
"w1,example.org.": weights{
"w1,example.org.": {
&weightItem{net.ParseIP("192.168.1.15"), uint8(10)},
&weightItem{net.ParseIP("192.168.1.14"), uint8(20)},
},
@ -43,12 +43,12 @@ w2.example.org
`
var testTwoDomainsWRR = map[string]weights{
"w1.example.org.": weights{
"w1.example.org.": {
&weightItem{net.ParseIP("192.168.1.15"), uint8(10)},
&weightItem{net.ParseIP("192.168.1.14"), uint8(20)},
},
"w2.example.org.": weights{},
"w3.example.org.": weights{
"w2.example.org.": {},
"w3.example.org.": {
&weightItem{net.ParseIP("192.168.2.16"), uint8(11)},
&weightItem{net.ParseIP("192.168.2.15"), uint8(12)},
&weightItem{net.ParseIP("192.168.2.14"), uint8(13)},
@ -234,17 +234,17 @@ func TestLoadBalanceWRR(t *testing.T) {
// domain maps to test
oneDomain := map[string]weights{
"endpoint.region2.skydns.test.": weights{
"endpoint.region2.skydns.test.": {
&weightItem{net.ParseIP("10.240.0.2"), uint8(3)},
&weightItem{net.ParseIP("10.240.0.1"), uint8(2)},
},
}
twoDomains := map[string]weights{
"endpoint.region2.skydns.test.": weights{
"endpoint.region2.skydns.test.": {
&weightItem{net.ParseIP("10.240.0.2"), uint8(5)},
&weightItem{net.ParseIP("10.240.0.1"), uint8(2)},
},
"endpoint.region1.skydns.test.": weights{
"endpoint.region1.skydns.test.": {
&weightItem{net.ParseIP("::2"), uint8(4)},
&weightItem{net.ParseIP("::1"), uint8(3)},
},

View file

@ -34,7 +34,6 @@
// valueFunc := metadata.ValueFunc(ctx, "test/something")
// value := valueFunc()
// // use 'value'
//
package metadata
import (

View file

@ -10,7 +10,6 @@
// See https://github.com/coredns/coredns/issues/2723 for some discussion on this, which includes this quote:
//
// TL;DR: `fallthrough` is indeed risky and hackish, but still a good feature of CoreDNS as it allows to quickly answer boring edge cases.
//
package fall
import (

View file

@ -34,10 +34,12 @@ func setTLSDefaults(ctls *tls.Config) {
// - creates a Config with no cert and using system CAs
// - use for a client that talks to a server with a public signed cert (CA installed in system)
// - the client will not be authenticated by the server since there is no cert
//
// one arg: the path to CA PEM file
// - creates a Config with no cert using a specific CA
// - use for a client that talks to a server with a private signed cert (CA not installed in system)
// - the client will not be authenticated by the server since there is no cert
//
// two args: path to cert PEM file, the path to private key PEM file
// - creates a Config with a cert, using system CAs to validate the other end
// - use for:
@ -45,6 +47,7 @@ func setTLSDefaults(ctls *tls.Config) {
// - a client that talks to a server with a public cert and needs certificate-based authentication
// - the other end will authenticate this end via the provided cert
// - the cert of the other end will be verified via system CAs
//
// three args: path to cert PEM file, path to client private key PEM file, path to CA PEM file
// - creates a Config with the cert, using specified CA to validate the other end
// - use for:

View file

@ -167,6 +167,7 @@ const escapeSeq = "\\"
// for everything else.
//
// Example:
//
// `\\052.example.com.` -> `*.example.com`
// `\\137.example.com.` -> error ('_' is not valid)
func maybeUnescape(s string) (string, error) {

View file

@ -35,9 +35,11 @@ PrivateKey: f03VplaIEA+KHI9uizlemUSbUJH86hPBPjmcUninPoM=
// actually works. Each corefile snippet is only used if the language is set to 'corefile':
//
// ~~~ corefile
//
// . {
// # check-this-please
// }
//
// ~~~
//
// While we're at it - we also check the README.md itself. It should at least have the sections: