versão 1
This commit is contained in:
commit
1cb4c14d33
85 changed files with 11836 additions and 0 deletions
41
verificar-linhas.sh
Normal file
41
verificar-linhas.sh
Normal file
|
|
@ -0,0 +1,41 @@
|
|||
#!/usr/bin/env sh
|
||||
|
||||
# comando sh ../.agent/verificar-linhas.sh || exit 1
|
||||
|
||||
LIMITE=250
|
||||
|
||||
RAIZ=$(cd "$(dirname "$0")/.." && pwd)
|
||||
|
||||
RESULTADO=$(
|
||||
find "$RAIZ" \
|
||||
-type d \( \
|
||||
-name node_modules -o \
|
||||
-name .git -o \
|
||||
-name dist -o \
|
||||
-name build \
|
||||
\) -prune \
|
||||
-o \
|
||||
-type f \( \
|
||||
-name "*.ts" -o \
|
||||
-name "*.tsx" -o \
|
||||
-name "*.vue" -o \
|
||||
-name "*.css" \
|
||||
\) \
|
||||
-print | while IFS= read -r arquivo; do
|
||||
linhas=$(wc -l < "$arquivo" | tr -d ' ')
|
||||
if [ "$linhas" -gt "$LIMITE" ]; then
|
||||
relativo="${arquivo#$RAIZ/}"
|
||||
printf "%5s linhas -> %s\n" "$linhas" "$relativo"
|
||||
fi
|
||||
done
|
||||
)
|
||||
|
||||
if [ -n "$RESULTADO" ]; then
|
||||
echo "$RESULTADO"
|
||||
VIOLACOES=$(printf '%s\n' "$RESULTADO" | wc -l | tr -d ' ')
|
||||
printf "\n❌ %s arquivo(s) violam o limite de %s linhas.\n" "$VIOLACOES" "$LIMITE"
|
||||
printf "\n Resolva usando o arquivo: .agent/workflows/otimizar-codigos.global.md\n"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
printf "✅ Todos os arquivos dentro do limite de %s linhas.\n" "$LIMITE"
|
||||
Loading…
Add table
Add a link
Reference in a new issue