Skip to content

Commit b03120f

Browse files
fix: use grep -F for baseline lookup to handle Go pointer receivers
The baseline comparison uses grep with the function key as the pattern. Go pointer receiver methods use (*Type).Method syntax, where (* is interpreted as a BRE quantifier ("zero or more open-parens") instead of the literal characters. This causes all pointer receiver functions to fail lookup and be misclassified as "new functions", triggering false CRAP threshold violations in consuming repositories. Switching to grep -F (fixed-string mode) ensures literal matching. The ^ anchor is dropped because -F does not support anchors, but collisions are not possible since keys are fully-qualified file:function paths unique by construction. Assisted-by: OpenCode (claude-opus-4-6) Signed-off-by: Marcus Burghardt <maburgha@redhat.com>
1 parent 0dd6d87 commit b03120f

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎.github/workflows/reusable_crapload_analysis.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ jobs:
174174
175175
# Process current scores
176176
while IFS=$'\t' read -r key crap gaze_crap; do
177-
baseline_line=$(grep "^${key} " /tmp/baseline-lookup.tsv || true)
177+
baseline_line=$(grep -F "${key} " /tmp/baseline-lookup.tsv || true)
178178
if [ -z "$baseline_line" ]; then
179179
# New function
180180
NEW_COUNT=$((NEW_COUNT + 1))

0 commit comments

Comments
 (0)