mirror of
https://github.com/SamTherapy/dnscrypt.git
synced 2024-10-02 16:32:51 +00:00
5ddb58f703
Graceful shutdown of the DNSCrypt server This PR implements Server.Shutdown(ctx context.Context) method that allows to shut down the DNSCrypt server gracefully. Some additional changes that were inadvertently made while doing that: 1. Added benchmark tests 2. Started using dns.ReadFromSessionUDP / dns.WriteToSessionUDP instead of implementing it by ourselves 3. Generally improved tests 4. Added depguard 5. Improved comments overall in the code
77 lines
2.1 KiB
YAML
77 lines
2.1 KiB
YAML
# options for analysis running
|
|
run:
|
|
# default concurrency is a available CPU number
|
|
concurrency: 4
|
|
|
|
# timeout for analysis, e.g. 30s, 5m, default is 1m
|
|
deadline: 2m
|
|
|
|
# which files to skip: they will be analyzed, but issues from them
|
|
# won't be reported. Default value is empty list, but there is
|
|
# no need to include all autogenerated files, we confidently recognize
|
|
# autogenerated files. If it's not please let us know.
|
|
skip-files:
|
|
- ".*generated.*"
|
|
- ".*_test.go"
|
|
|
|
# all available settings of specific linters
|
|
linters-settings:
|
|
gocyclo:
|
|
min-complexity: 20
|
|
lll:
|
|
line-length: 200
|
|
depguard:
|
|
list-type: blacklist
|
|
include-go-root: false
|
|
packages:
|
|
- golang.org/x/net/context # we use context
|
|
- log # we use github.com/AdguardTeam/golibs/log
|
|
|
|
linters:
|
|
enable:
|
|
- deadcode
|
|
- errcheck
|
|
- govet
|
|
- ineffassign
|
|
- staticcheck
|
|
- structcheck
|
|
- unused
|
|
- varcheck
|
|
- bodyclose
|
|
- depguard
|
|
- dupl
|
|
- gocyclo
|
|
- goimports
|
|
- golint
|
|
- gosec
|
|
- misspell
|
|
- stylecheck
|
|
- unconvert
|
|
- depguard
|
|
disable-all: true
|
|
fast: true
|
|
|
|
|
|
issues:
|
|
exclude-use-default: false
|
|
|
|
# List of regexps of issue texts to exclude, empty list by default.
|
|
# But independently from this option we use default exclude patterns,
|
|
# it can be disabled by `exclude-use-default: false`. To list all
|
|
# excluded by default patterns execute `golangci-lint run --help`
|
|
exclude:
|
|
# errcheck defer Close
|
|
- error return value not checked \(defer .*\.Close()\)
|
|
# errcheck: Almost all programs ignore errors on these functions and in most cases it's ok
|
|
- Error return value of .((os\.)?std(out|err)\..*|.*Close|.*Flush|os\.Remove(All)?|.*printf?|os\.(Un)?Setenv). is not checked
|
|
# gosec: Duplicated errcheck checks
|
|
- G104
|
|
# gosec: Expect file permissions to be 0600 or less
|
|
- G302
|
|
# gosec: Use of weak random number generators
|
|
- G404
|
|
# errcheck defer Close
|
|
- error return value not checked \(defer .*\.Close()\)
|
|
# gosec: False positive is triggered by 'src, err := ioutil.ReadFile(filename)'
|
|
- Potential file inclusion via variable
|