mirror of
https://github.com/tarampampam/error-pages.git
synced 2024-08-30 18:22:40 +00:00
chore(deps): update dependency golangci/golangci-lint to v1.60.2 (#305)
* chore(deps): update dependency golangci/golangci-lint to v1.60.2 * linter fixes --------- Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Paramtamtam <7326800+tarampampam@users.noreply.github.com>
This commit is contained in:
parent
9fe6b32572
commit
4892822343
@ -61,7 +61,7 @@ linters: # All available linters list: <https://golangci-lint.run/usage/linters/
|
|||||||
- errcheck # Errcheck is a program for checking for unchecked errors in go programs. These unchecked errors can be critical bugs in some cases
|
- errcheck # Errcheck is a program for checking for unchecked errors in go programs. These unchecked errors can be critical bugs in some cases
|
||||||
- errorlint # find code that will cause problems with the error wrapping scheme introduced in Go 1.13
|
- errorlint # find code that will cause problems with the error wrapping scheme introduced in Go 1.13
|
||||||
- exhaustive # check exhaustiveness of enum switch statements
|
- exhaustive # check exhaustiveness of enum switch statements
|
||||||
- exportloopref # checks for pointers to enclosing loop variables
|
- copyloopvar # detects places where loop variables are copied
|
||||||
- funlen # Tool for detection of long functions
|
- funlen # Tool for detection of long functions
|
||||||
- gci # Gci control golang package import order and make it always deterministic
|
- gci # Gci control golang package import order and make it always deterministic
|
||||||
- godot # Check if comments end in a period
|
- godot # Check if comments end in a period
|
||||||
|
@ -8,7 +8,7 @@ ENV GOPATH="/var/tmp/go"
|
|||||||
|
|
||||||
RUN set -x \
|
RUN set -x \
|
||||||
# renovate: source=github-releases name=golangci/golangci-lint
|
# renovate: source=github-releases name=golangci/golangci-lint
|
||||||
&& GOLANGCI_LINT_VERSION="1.60.1" \
|
&& GOLANGCI_LINT_VERSION="1.60.2" \
|
||||||
&& wget -O- -nv "https://cdn.jsdelivr.net/gh/golangci/golangci-lint@v${GOLANGCI_LINT_VERSION}/install.sh" \
|
&& wget -O- -nv "https://cdn.jsdelivr.net/gh/golangci/golangci-lint@v${GOLANGCI_LINT_VERSION}/install.sh" \
|
||||||
| sh -s -- -b /bin "v${GOLANGCI_LINT_VERSION}"
|
| sh -s -- -b /bin "v${GOLANGCI_LINT_VERSION}"
|
||||||
|
|
||||||
|
@ -150,7 +150,7 @@ func NewCommand(log *logger.Logger) *cli.Command { //nolint:funlen,gocognit
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (cmd *command) Run( //nolint:funlen,gocognit
|
func (cmd *command) Run( //nolint:funlen,gocognit
|
||||||
ctx context.Context,
|
_ context.Context,
|
||||||
log *logger.Logger,
|
log *logger.Logger,
|
||||||
cfg *config.Config,
|
cfg *config.Config,
|
||||||
) error {
|
) error {
|
||||||
@ -176,7 +176,7 @@ func (cmd *command) Run( //nolint:funlen,gocognit
|
|||||||
var outFilePath = path.Join(cmd.opt.targetDirAbsPath, templateName, code+".html")
|
var outFilePath = path.Join(cmd.opt.targetDirAbsPath, templateName, code+".html")
|
||||||
|
|
||||||
if content, renderErr := appTemplate.Render(templateContent, appTemplate.Props{ //nolint:nestif
|
if content, renderErr := appTemplate.Render(templateContent, appTemplate.Props{ //nolint:nestif
|
||||||
Code: uint16(codeAsUint),
|
Code: uint16(codeAsUint), //nolint:gosec
|
||||||
Message: codeDescription.Message,
|
Message: codeDescription.Message,
|
||||||
Description: codeDescription.Description,
|
Description: codeDescription.Description,
|
||||||
L10nDisabled: cfg.L10n.Disable,
|
L10nDisabled: cfg.L10n.Disable,
|
||||||
|
@ -108,10 +108,10 @@ func NewCommand() *cli.Command { //nolint:funlen
|
|||||||
var runTest = func(scriptContent string) error {
|
var runTest = func(scriptContent string) error {
|
||||||
if stdOut, stdErr, err := wrkRunTest(ctx,
|
if stdOut, stdErr, err := wrkRunTest(ctx,
|
||||||
wrkBinPath,
|
wrkBinPath,
|
||||||
uint16(c.Uint(threadsFlag.Name)),
|
uint16(c.Uint(threadsFlag.Name)), //nolint:gosec
|
||||||
uint16(c.Uint(connectionsFlag.Name)),
|
uint16(c.Uint(connectionsFlag.Name)), //nolint:gosec
|
||||||
c.Duration(durationFlag.Name),
|
c.Duration(durationFlag.Name),
|
||||||
uint16(c.Uint(portFlag.Name)),
|
uint16(c.Uint(portFlag.Name)), //nolint:gosec
|
||||||
scriptContent,
|
scriptContent,
|
||||||
); err != nil {
|
); err != nil {
|
||||||
var errData, _ = io.ReadAll(stdErr)
|
var errData, _ = io.ReadAll(stdErr)
|
||||||
|
@ -176,10 +176,10 @@ func NewCommand(log *logger.Logger) *cli.Command { //nolint:funlen,gocognit,gocy
|
|||||||
Suggest: true,
|
Suggest: true,
|
||||||
Action: func(ctx context.Context, c *cli.Command) error {
|
Action: func(ctx context.Context, c *cli.Command) error {
|
||||||
cmd.opt.http.addr = c.String(addrFlag.Name)
|
cmd.opt.http.addr = c.String(addrFlag.Name)
|
||||||
cmd.opt.http.port = uint16(c.Uint(portFlag.Name))
|
cmd.opt.http.port = uint16(c.Uint(portFlag.Name)) //nolint:gosec
|
||||||
cmd.opt.http.readBufferSize = uint(c.Uint(readBufferSizeFlag.Name))
|
cmd.opt.http.readBufferSize = uint(c.Uint(readBufferSizeFlag.Name))
|
||||||
cfg.L10n.Disable = c.Bool(disableL10nFlag.Name)
|
cfg.L10n.Disable = c.Bool(disableL10nFlag.Name)
|
||||||
cfg.DefaultCodeToRender = uint16(c.Uint(defaultCodeToRenderFlag.Name))
|
cfg.DefaultCodeToRender = uint16(c.Uint(defaultCodeToRenderFlag.Name)) //nolint:gosec
|
||||||
cfg.RespondWithSameHTTPCode = c.Bool(sendSameHTTPCodeFlag.Name)
|
cfg.RespondWithSameHTTPCode = c.Bool(sendSameHTTPCodeFlag.Name)
|
||||||
cfg.RotationMode, _ = config.ParseRotationMode(c.String(rotationModeFlag.Name))
|
cfg.RotationMode, _ = config.ParseRotationMode(c.String(rotationModeFlag.Name))
|
||||||
cfg.ShowDetails = c.Bool(showDetailsFlag.Name)
|
cfg.ShowDetails = c.Bool(showDetailsFlag.Name)
|
||||||
|
@ -97,5 +97,5 @@ func getFreeTcpPort(t *testing.T) uint16 {
|
|||||||
<-time.After(5 * time.Millisecond)
|
<-time.After(5 * time.Millisecond)
|
||||||
}
|
}
|
||||||
|
|
||||||
return uint16(port)
|
return uint16(port) //nolint:gosec
|
||||||
}
|
}
|
||||||
|
@ -28,7 +28,7 @@ func extractCodeFromURL(url string) (uint16, bool) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if code, err := strconv.ParseUint(fileName, 10, 16); err == nil && code > 0 && code < 999 {
|
if code, err := strconv.ParseUint(fileName, 10, 16); err == nil && code > 0 && code < 999 {
|
||||||
return uint16(code), true
|
return uint16(code), true //nolint:gosec
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0, false
|
return 0, false
|
||||||
@ -47,7 +47,7 @@ func extractCodeFromHeaders(headers *fasthttp.RequestHeader) (uint16, bool) {
|
|||||||
// HTTP status code returned by the request
|
// HTTP status code returned by the request
|
||||||
if value := headers.Peek("X-Code"); len(value) > 0 && len(value) <= 3 {
|
if value := headers.Peek("X-Code"); len(value) > 0 && len(value) <= 3 {
|
||||||
if code, err := strconv.ParseUint(string(value), 10, 16); err == nil && code > 0 && code < 999 {
|
if code, err := strconv.ParseUint(string(value), 10, 16); err == nil && code > 0 && code < 999 {
|
||||||
return uint16(code), true
|
return uint16(code), true //nolint:gosec
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -40,7 +40,7 @@ func NewServer(log *logger.Logger, readBufferSize uint) Server {
|
|||||||
server: &fasthttp.Server{
|
server: &fasthttp.Server{
|
||||||
ReadTimeout: readTimeout,
|
ReadTimeout: readTimeout,
|
||||||
WriteTimeout: writeTimeout,
|
WriteTimeout: writeTimeout,
|
||||||
ReadBufferSize: int(readBufferSize),
|
ReadBufferSize: int(readBufferSize), //nolint:gosec
|
||||||
DisablePreParseMultipartForm: true,
|
DisablePreParseMultipartForm: true,
|
||||||
NoDefaultServerHeader: true,
|
NoDefaultServerHeader: true,
|
||||||
CloseOnShutdown: true,
|
CloseOnShutdown: true,
|
||||||
|
@ -392,5 +392,5 @@ func getFreeTcpPort(t *testing.T) uint16 {
|
|||||||
<-time.After(5 * time.Millisecond)
|
<-time.After(5 * time.Millisecond)
|
||||||
}
|
}
|
||||||
|
|
||||||
return uint16(port)
|
return uint16(port) //nolint:gosec
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user