Skip to content

Commit

Permalink
Attempt the refactoring using ChatGPT's tips
Browse files Browse the repository at this point in the history
  • Loading branch information
Raleksan committed Oct 3, 2024
1 parent 03d1b17 commit 0e7237d
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions steps/report.sh
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,11 @@ st_list=${TARGET}/temp/structured-list-of-metrics.tex
rm -f "${st_list}"
touch "${st_list}"

groups=()
while IFS='' read -r line; do
groups+=("$line")
done < <(grep -oP '\[.*?\]' "${list}" | sed 's/[][]//g' || : ; echo "Ungrouped metrics")
mapfile -t groups < <(grep -oP '\[.*?\]' "${list}")
for idx in "${!groups[@]}"; do
groups[idx]="${groups[idx]//[\[\]]/}"
done
groups+=("Ungrouped metrics")
for idx in ${!groups[@]}; do
printf "\\item %s\n" "${groups[$idx]}" >> "${st_list}"
printf "\\\\begin{itemize}\n" >> "${st_list}"
Expand Down

0 comments on commit 0e7237d

Please sign in to comment.