mirror of
https://github.com/metabarcoding/obitools4.git
synced 2026-04-30 03:50:39 +00:00
⬆️ version bump to v4.5
- Update obioptions.Version from "Release 4.4.29" to "/v/ Release v5" - Update version.txt from 4.29 → .30 (automated by Makefile)
This commit is contained in:
Executable
+36
@@ -0,0 +1,36 @@
|
||||
#!/bin/bash
|
||||
|
||||
basePath="/Users/coissac/Sync/travail/__MOI__/GO/obitools4"
|
||||
OUTPUT_FILE="${1:-/dev/stdout}"
|
||||
|
||||
# Get all SetAttribute calls
|
||||
rg -n '\.SetAttribute\(' "$basePath/pkg" --type go | while read -r line; do
|
||||
file="${line%%:*}"
|
||||
line_num="${line%:*}"
|
||||
line_num="${line_num##*:}"
|
||||
context="${line##*: }"
|
||||
|
||||
# Extract key (only literal strings)
|
||||
key=$(echo "$context" | sed -n 's/.*SetAttribute("\([^"]*\)".*/\1/p')
|
||||
[ -z "$key" ] && continue
|
||||
|
||||
# Get function name using treesitter
|
||||
func=$(kilo treesitter_cursor_walk \
|
||||
--file_path "$file" \
|
||||
--row "$((line_num - 1))" \
|
||||
--column 0 \
|
||||
--max_depth 10 2>/dev/null |
|
||||
jq -r '.ancestors[] | select(.type == "function_declaration" or .type == "method_declaration") | .children[] | select(.type == "identifier" or .type == "field_identifier") | .text' 2>/dev/null)
|
||||
|
||||
# Fallback to func_literal for closures
|
||||
if [ -z "$func" ]; then
|
||||
func=$(kilo treesitter_cursor_walk \
|
||||
--file_path "$file" \
|
||||
--row "$((line_num - 1))" \
|
||||
--column 0 \
|
||||
--max_depth 10 2>/dev/null |
|
||||
jq -r '.ancestors[] | select(.type == "func_literal") | "closure"' 2>/dev/null)
|
||||
fi
|
||||
|
||||
echo "$(basename "$file")|$line_num|$key|${func:-unknown}|$context"
|
||||
done | sort -t'|' -k1,1 -k2,2n
|
||||
Reference in New Issue
Block a user