diff --git a/.golangci.yml b/.golangci.yml index 70b900fe5..a82fa2488 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -16,6 +16,7 @@ linters: - durationcheck - errchkjson - errorlint + - exhaustive - forbidigo - gocritic - gocyclo @@ -137,6 +138,9 @@ linters: - G401 - G505 - G115 + exhaustive: + # third-party enums: listing every value only adds noise; our own enums must be listed in full + ignore-enum-types: ^(reflect\.Kind|go\.senan\.xyz/taglib\.FileFormat)$ forbidigo: forbid: - pattern: 'tx\.Exec$' diff --git a/core/artwork/processor.go b/core/artwork/processor.go index 17e88413e..ad698ef45 100644 --- a/core/artwork/processor.go +++ b/core/artwork/processor.go @@ -45,6 +45,8 @@ func (o outcome) String() string { return "foundStale" case outcomeAbsent: return "absent" + case outcomeFailed: + fallthrough default: return "failed" } diff --git a/core/ffmpeg/ffmpeg.go b/core/ffmpeg/ffmpeg.go index ce7c3a6c4..f7d1708a9 100644 --- a/core/ffmpeg/ffmpeg.go +++ b/core/ffmpeg/ffmpeg.go @@ -643,6 +643,7 @@ func (p *encoderProbe) has(cmdPath, encoder string) bool { return true case encoderProbeUnavailable: return false + case encoderProbeUnknown: } ctx, cancel := context.WithTimeout(context.Background(), 5*time.Second) diff --git a/model/metadata/metadata.go b/model/metadata/metadata.go index 7843e7010..91411a54e 100644 --- a/model/metadata/metadata.go +++ b/model/metadata/metadata.go @@ -216,6 +216,8 @@ func clean(filePath string, tags model.RawTags) model.Tags { switch mapping.Type { case model.TagTypePair: values = processPairMapping(name, mapping, lowered) + case model.TagTypeString, model.TagTypeInteger, model.TagTypeFloat, model.TagTypeDate, model.TagTypeUUID: + fallthrough default: values = processRegularMapping(mapping, lowered) } @@ -409,6 +411,7 @@ func sanitize(filePath string, tagName model.TagName, tag model.TagConf, value s // Store the canonical form: uuid.Parse accepts braces, urn: prefixes and any // two-byte wrapper, and a wrapped value would never match an exact-match query value = u.String() + case model.TagTypeString, model.TagTypePair: } return value } diff --git a/plugins/manager_watcher.go b/plugins/manager_watcher.go index b5e7eba04..d0d02ef3e 100644 --- a/plugins/manager_watcher.go +++ b/plugins/manager_watcher.go @@ -217,5 +217,6 @@ func (m *Manager) processPluginEvent(pluginName string) { if err := m.removePluginFromDB(ctx, repo, dbPlugin); err != nil { log.Error(m.ctx, "Failed to delete plugin from DB", "plugin", pluginName, err) } + case actionNone: } } diff --git a/utils/shellquote/shellquote.go b/utils/shellquote/shellquote.go index 7b50fa9cc..bcd4438e0 100644 --- a/utils/shellquote/shellquote.go +++ b/utils/shellquote/shellquote.go @@ -105,6 +105,7 @@ func Split(input string) ([]string, error) { return nil, ErrUnterminatedSingleQuote case stateDoubleQuoted: return nil, ErrUnterminatedDoubleQuote + case stateUnquoted: } if inWord {