Skip to content

Commit ac29f9f

Browse files
committed
Fix bug with churn failing
1 parent 7f3e013 commit ac29f9f

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

tools.d/churn

+2
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ tmpdir=$(mktemp -d)
77
OUTPUT="${tmpdir}/churned"
88
CSV="${tmpdir}/findings.csv"
99
TOP_N_CHURNED_FILES=10
10+
touch $CSV
1011

1112
if [ -x "./csv2sarif.rb" ]; then
1213
csv2sarif="./csv2sarif.rb"
@@ -21,6 +22,7 @@ git -C "${source}" log --format=format: --name-only --since=12.month \
2122
| sort -nr \
2223
| awk -v n=${TOP_N_CHURNED_FILES} 'NR <= n {print $2, $1}' > "${OUTPUT}"
2324

25+
2426
while read -r filename _commits; do
2527
printf "%s,%s,%s,%s,%s,%s\n" "top-file-churns" "note" "File has been committed to frequently. This may indicate design issues." "${filename}" 0 0 >> "$CSV"
2628
done < "${OUTPUT}"

0 commit comments

Comments
 (0)