From 26aa171b2bc13df045d7bb28c759be63d9b722ab Mon Sep 17 00:00:00 2001 From: Jo Date: Mon, 19 Feb 2024 11:29:47 +0100 Subject: [PATCH] fix(query): remove -debug packages from missing list if base package is installed (#2372) * chore(yay): fix pre-commit * chore(yay): fix git ignore --- .gitignore | 2 ++ .pre-commit-config.yaml | 8 +++----- pkg/query/aur_warnings.go | 8 ++++++-- 3 files changed, 11 insertions(+), 7 deletions(-) diff --git a/.gitignore b/.gitignore index 993bf93f0..b41303cbd 100644 --- a/.gitignore +++ b/.gitignore @@ -28,3 +28,5 @@ qemu-* *.pot *.po~ *.pprof + +node_modules/ diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 53091619d..128573a7f 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -5,19 +5,17 @@ repos: rev: v0.5.1 hooks: - id: go-fmt - - id: go-imports - args: [-local=github.com/Jguer/yay/v12/] - id: golangci-lint - id: go-unit-tests - id: go-build - repo: https://github.com/pre-commit/mirrors-prettier - rev: v3.0.0-alpha.4 # Use the sha or tag you want to point at + rev: v4.0.0-alpha.8 # Use the sha or tag you want to point at hooks: - id: prettier - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.4.0 # Use the ref you want to point at + rev: v4.5.0 # Use the ref you want to point at hooks: - id: trailing-whitespace - id: check-json @@ -25,7 +23,7 @@ repos: - id: check-added-large-files - repo: https://github.com/commitizen-tools/commitizen - rev: v2.38.0 + rev: v3.15.0 hooks: - id: commitizen stages: [commit-msg] diff --git a/pkg/query/aur_warnings.go b/pkg/query/aur_warnings.go index a4e138010..cbfe1cac9 100644 --- a/pkg/query/aur_warnings.go +++ b/pkg/query/aur_warnings.go @@ -52,10 +52,14 @@ func (warnings *AURWarnings) AddToWarnings(remote map[string]alpm.IPackage, aurP } } -func (warnings *AURWarnings) CalculateMissing(remoteNames []string, remote map[string]alpm.IPackage, aurData map[string]*aur.Pkg) { +func (warnings *AURWarnings) CalculateMissing(remoteNames []string, + remote map[string]alpm.IPackage, aurData map[string]*aur.Pkg, +) { for _, name := range remoteNames { if _, ok := aurData[name]; !ok && !remote[name].ShouldIgnore() { - warnings.Missing = append(warnings.Missing, name) + if _, ok := aurData[strings.TrimSuffix(name, "-debug")]; !ok { + warnings.Missing = append(warnings.Missing, name) + } } } }