diff options
author | Alexander Foremny <aforemny@posteo.de> | 2023-09-29 11:33:15 +0200 |
---|---|---|
committer | Alexander Foremny <aforemny@posteo.de> | 2023-09-29 11:37:01 +0200 |
commit | 24700382f2e1f9b1dac1de3e8170294cf0c818d4 (patch) | |
tree | 6eb4a8c469912307c7b767f1894ce5504845266f /src/extract.sh | |
parent | 3592e5b055ad0fcd70d1ae9e4804a4b5c6a77c5d (diff) |
fix extracting body for shell issues
The underlying problem is that tree-sitter does not allow for matching
sibling nodes. So any issues comprised of line comments (vs. block
comments) suffered from this issue, independent of the language (shell).
Thus, we manually merge such sibling matches after running tree-grepper.
Diffstat (limited to 'src/extract.sh')
-rwxr-xr-x | src/extract.sh | 13 |
1 files changed, 2 insertions, 11 deletions
diff --git a/src/extract.sh b/src/extract.sh index 6422694..07346fc 100755 --- a/src/extract.sh +++ b/src/extract.sh @@ -80,17 +80,8 @@ git ls-files --cached --exclude-standard --other | head -n 1) created_at=$(git show $first_commit --no-patch --format=%ad) - heading=$(echo "$text" | sed '/^$/Q' | sed 's/.*TODO //') - # TODO body is not extracted in shell scripts - # - # @assigned aforemny - # @assigned kirchner@posteo.de - # @scheduled 2023-10-03 - body=$(echo "$text" | tail -n +$(($(echo "$heading" | wc -l) + 2)) | \ - awk -F '[^ ]' ' - NR == 1 {n = length($1)} - {sub("^ {1,"n"}", ""); print}' - ) + heading=$(echo "$text" | sed -n '0,/^$/p') + body=$(echo "$text" | tail -n +$(($(echo "$heading" | wc -l) + 2))) echo "$item" | jq -c \ --arg body "$body" \ |