mirror of
https://github.com/stashapp/stash.git
synced 2025-12-15 21:03:22 +01:00
* Make copies of buffers Avoid reusing one of the incoming arrays as a append extension, and make a copy of the data. It's cleaner in the long run and possibly easier for the GC to maintain. * Avoid appendAssign problems in tag code Reuse the existing slice when appending. * Fix appendAssign in encoder_scene_preview_chunk Appending and creating a new slice is somewhat unintuitive since the underlying slice might be extended to satisfy the new capacity. This sometimes leads to faulty logic. Rewrite the code so it reuses `args` for all appending, and builds one array clearly in the code. It follows the general style of the function where `args` is being built in small incremental batches and avoids the introduction of new names. * Enable the appendAssign check This makes us pass all gocritic warnings. Co-authored-by: WithoutPants <53250216+WithoutPants@users.noreply.github.com>
91 lines
1.9 KiB
YAML
91 lines
1.9 KiB
YAML
# options for analysis running
|
|
run:
|
|
timeout: 3m
|
|
modules-download-mode: vendor
|
|
|
|
linters:
|
|
disable-all: true
|
|
enable:
|
|
# Default set of linters from golangci-lint
|
|
- deadcode
|
|
- errcheck
|
|
- gosimple
|
|
- govet
|
|
- ineffassign
|
|
- staticcheck
|
|
- structcheck
|
|
- typecheck
|
|
- unused
|
|
- varcheck
|
|
# Linters added by the stash project.
|
|
- dogsled
|
|
- errorlint
|
|
# - exhaustive
|
|
- exportloopref
|
|
- gocritic
|
|
# - goerr113
|
|
- gofmt
|
|
# - gomnd
|
|
# - ifshort
|
|
- misspell
|
|
# - nakedret
|
|
- noctx
|
|
- revive
|
|
- rowserrcheck
|
|
- sqlclosecheck
|
|
|
|
# Project-specific linter overrides
|
|
linters-settings:
|
|
gofmt:
|
|
simplify: false
|
|
|
|
errorlint:
|
|
# Disable errorf because there are false positives, where you don't want to wrap
|
|
# an error.
|
|
errorf: false
|
|
asserts: true
|
|
comparison: true
|
|
|
|
revive:
|
|
ignore-generated-header: true
|
|
severity: error
|
|
confidence: 0.8
|
|
error-code: 1
|
|
warning-code: 1
|
|
rules:
|
|
- name: blank-imports
|
|
disabled: true
|
|
- name: context-as-argument
|
|
- name: context-keys-type
|
|
- name: dot-imports
|
|
- name: error-return
|
|
- name: error-strings
|
|
- name: error-naming
|
|
- name: exported
|
|
disabled: true
|
|
- name: if-return
|
|
disabled: true
|
|
- name: increment-decrement
|
|
- name: var-naming
|
|
disabled: true
|
|
- name: var-declaration
|
|
- name: package-comments
|
|
- name: range
|
|
- name: receiver-naming
|
|
- name: time-naming
|
|
- name: unexported-return
|
|
disabled: true
|
|
- name: indent-error-flow
|
|
disabled: true
|
|
- name: errorf
|
|
- name: empty-block
|
|
disabled: true
|
|
- name: superfluous-else
|
|
- name: unused-parameter
|
|
disabled: true
|
|
- name: unreachable-code
|
|
- name: redefines-builtin-id
|
|
|
|
rowserrcheck:
|
|
packages:
|
|
- github.com/jmoiron/sqlx
|