From 46031227599d01bd44152ad3b29c139ba2305146 Mon Sep 17 00:00:00 2001 From: Piotr Rygielski <114479+vikin91@users.noreply.github.com> Date: Tue, 25 Aug 2026 11:37:04 +0200 Subject: [PATCH] fix quickstyle: run golangci-lint from the checked-out repo quickstyle passed absolute package dirs. With two clones next to each other, golangci-lint reported ../sibling/central/... so wrapcheck exclusions like ^central/ did not match. cd to gitroot and strip that prefix so the invocation matches make golangci-lint in this clone. User request: fix the wrapcheck false positives in quickstyle (workflow repo), not in stackrox .golangci.yml. Partially generated by AI. rh-pre-commit.version: 2.3.2 rh-pre-commit.check-secrets: ENABLED --- scripts/dev/quickstyle.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/scripts/dev/quickstyle.sh b/scripts/dev/quickstyle.sh index 4f5aa80..d13f2c1 100755 --- a/scripts/dev/quickstyle.sh +++ b/scripts/dev/quickstyle.sh @@ -216,7 +216,9 @@ function gostyle() { local golangci_lint_bin golangci_lint_bin="$(resolve_tool_path golangci-lint)" || golangci_lint_bin="" if [[ -n "${golangci_lint_bin}" && -x "${golangci_lint_bin}" ]]; then - "${golangci_lint_bin}" run --allow-parallel-runners "${godirs[@]}" --fix && (( status == 0 )) + # cd here and drop the gitroot prefix so we lint this clone, like CI. + local prefix="${gitroot}/" + (cd "${gitroot}" && "${golangci_lint_bin}" run --allow-parallel-runners "${godirs[@]#"$prefix"}" --fix) && (( status == 0 )) status=$? else ewarn "No golangci-lint binary found, but the repo has a config file. Skipping..."