initial commit

This commit is contained in:
2026-06-02 06:09:41 +02:00
commit 8d15b834c3
13 changed files with 510 additions and 0 deletions
+25
View File
@@ -0,0 +1,25 @@
#!/usr/bin/env bash
# Checks the given argument path (expected to be a tags file) for the correct tags style.
set -euo pipefail
STDLIB_PATH=$(realpath -e "$(dirname "$0")/..")
source "$STDLIB_PATH/vendor/std/src/lib.sh"
FILEPATH=${1?Expected a file path as argument}
while read -r line; do
IFS=$'\t' read -r name location _ctx ty <<<"$line"
[[ "$ty" == "f" ]] || continue
# if after splitting no subsegment is empty or invalid, then the separators
# were used properly
while read -r segment; do
while read -r subsegment; do
std::assert "$name: Subsegment should not be empty ($location)" -n "$subsegment"
std::assert-regex "$name: Function subsegment '$subsegment' should be [a-z0-9] ($location)" "$subsegment" "^[a-z0-9]+$"
done <<<"${segment//-/$' \n'}"
done <<<"${name//::/$'\n'}"
done <"$FILEPATH"