Skip to content

Commit

Permalink
presenting the message of the requirements as their own column
Browse files Browse the repository at this point in the history
  • Loading branch information
Jan-Piotraschke committed Apr 19, 2024
1 parent c363681 commit 763235d
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions scripts/summarize_requirements.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,17 @@ done < <(git log --pretty=format:%s)
find . -name "requirements.md" | sort | while read file; do
directory=$(dirname "$file")
echo "## Requirements from $directory" >> SUMMARY.md
echo "| Requirement ID | Present in Git History |" >> SUMMARY.md
echo "|----------------|------------------------|" >> SUMMARY.md
echo "| Requirement ID | Description | Present in Git History |" >> SUMMARY.md
echo "|----------------|-------------|-----------------------|" >> SUMMARY.md
# Ensure that all lines, including those that might end without a newline, are read
while IFS= read -r line || [[ -n "$line" ]]; do
[[ -z "$line" ]] && continue # Skip empty lines
# Extract requirement ID
req_id=$(echo "$line" | grep -o '\[.*\]')
# Escape brackets for use in sed
escaped_req_id=$(echo "$req_id" | sed 's/[][]/\\&/g')
# Extract the description text
description=$(echo "$line" | sed -e "s/^$escaped_req_id //")
# Initialize a flag to false
found="No"
# Check if the requirement ID is present in any commit message
Expand All @@ -29,7 +33,7 @@ find . -name "requirements.md" | sort | while read file; do
break
fi
done
echo "| $line | $found |" >> SUMMARY.md
echo "| $req_id | $description | $found |" >> SUMMARY.md
done < "$file"
echo "" >> SUMMARY.md
done

0 comments on commit 763235d

Please sign in to comment.