Skip to content

Commit 7657fa4

Browse files
committed
Refine Radon analysis workflow to capture raw output and improve method detection
1 parent 85b0643 commit 7657fa4

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

.github/workflows/radon-anylsis-granular.yml

+8-3
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,13 @@ jobs:
4040
for FILE in $CHANGED_FILES; do
4141
echo "Processing file: $FILE"
4242
43-
# Get method names and their line numbers
44-
METHODS=$(radon cc $FILE -s | grep -oP "^\s*\d+.*\K[^\(]+" || true)
43+
# Run radon cc and check the raw output
44+
RADON_OUTPUT=$(radon cc $FILE -s || true)
45+
echo "Raw Radon Output for $FILE:"
46+
echo "$RADON_OUTPUT"
47+
48+
# Check if there are methods in the output
49+
METHODS=$(echo "$RADON_OUTPUT" | grep -oP "^\s*\d+.*\K[^\(]+" || true)
4550
echo "Methods found: $METHODS"
4651
4752
# Extract the lines that are changed in this file
@@ -50,7 +55,7 @@ jobs:
5055
LINE_NUMBER=$(echo $LINE | grep -oP '(?<=\+)\d+')
5156
5257
# Match the method based on line number
53-
MATCHING_METHOD=$(radon cc $FILE -s | awk -v line=$LINE_NUMBER '{
58+
MATCHING_METHOD=$(echo "$RADON_OUTPUT" | awk -v line=$LINE_NUMBER '{
5459
if ($1 ~ /^[0-9]+:/ && $1 <= line) method=$NF;
5560
if ($1 > line) { print method; exit }
5661
}')

0 commit comments

Comments
 (0)